//package android.handler;
//
///**
// * @author Ajie
// * @date 11/11/21
// * @function
// */
////package com.beeboxes.systemupgrade;
//
//        import android.util.*;
//        import java.security.*;
//        import android.content.res.*;
//        import android.text.format.*;
//        import java.util.*;
//        import android.content.*;
//        import android.support.v4.content.*;
//        import android.support.v4.app.*;
//        import android.app.*;
//        import java.io.*;
//        import android.widget.*;
//        import android.os.*;
//        import android.support.v7.app.*;
//        import android.view.*;
//
//public class SystemUpgradeActivity extends AppCompatActivity implements View$OnClickListener, CompoundButton$OnCheckedChangeListener {
//    private static final int ACTION_REBOOT_BOOTLOADER = 3;
//    private static final int ACTION_REBOOT_DEVICE = 4;
//    private static final int ACTION_REBOOT_FACTORYRESET = 1;
//    private static final int ACTION_REBOOT_INVALID = 0;
//    private static final int ACTION_REBOOT_RECOVERY = 2;
//    private static final String BBOX_HUBRESET_DISABLE = "0";
//    private static final String BBOX_HUBRESET_ENABLE = "1";
//    private static final String BBOX_USB_MODE_SWITCH_VALUE = "bbox_usb_switch = 0";
//    private static final String BBOX_USB_SWITCH_DISABLE = "0";
//    private static final String BBOX_USB_SWITCH_ENABLE = "1";
//    private static final String CACHE_DIR = "/cache";
//    private static final String CACHE_UPDATE_FILE = "/cache/update.zip";
//    private static final long CLICK_DURATIOIN = 3000L;
//    private static final String COMMAND_FILE = "/cache/recovery/command";
//    private static final String COMMAND_LOCALE = "--locale=zh-CN\n";
//    private static final String COMMAND_UPDATE_PACKAGE = "--update_package=";
//    private static final String COMMAND_WIPA = "--wipe_data\n";
//    private static final int COUNT_TIME_SECOND = 10;
//    private static final long GIGABYTE_KB = 1048576L;
//    private static final String INTERNAL_STORAGE_PATH = "/data/media/0";
//    private static final String INVALID_USB_DEVICE = "/mnt/media_rw/usbotg";
//    private static final int MAX_CLICK_COUNT = 7;
//    private static final long MIN_CACHE_PARTITION_SIZE_KB = 1572864L;
//    private static final String OTACERTS_FOLDER = "otacerts";
//    private static final String OTACERTS_OFFICIAL_FILES_PREFIX = "otacerts_official";
//    private static final String OTACERTS_TEST_FILES_PREFIX = "otacerts_test";
//    private static final String OTG_DEVICE_PATH = "/mnt/media_rw/usbotgoem";
//    private static final String OTG_MOUNT_PATH = "/mnt/media_rw/usbotgoem";
//    private static String[] PERMISSIONS_ARRAYS;
//    private static final String PROC_MOUNTS_FILE = "/proc/mounts";
//    private static final String PROP_DEBUG_BBOX_USB_HUBRESET = "debug.bbox.usb_hubreset";
//    private static final String PROP_DEBUG_BBOX_USB_SWITCH = "debug.bbox.usb_switch";
//    private static final String PROP_DEBUG_BBOX_VCC5V_ENABLE = "debug.bbox.vcc5v_enable";
//    private static final String PROP_DEVICE_HW_VERSION = "ro.bbox.hw.version";
//    private static final String RECOVERY_DIR = "/cache/recovery";
//    private static final int REQUEST_CODE = 1;
//    private static final int RET_ERR_NOT_READ = 3;
//    private static final int RET_ERR_NO_DEVICE = 1;
//    private static final int RET_ERR_NO_FILE = 2;
//    private static final int RET_INVALID = 0;
//    private static final int RET_NO_ERR = 4;
//    private static final String SYS_FILE_BBOX_HUBRESET_ENABLE = "/sys/bus/platform/drivers/bbox_gpioctrl/bbox_hubreset_enable";
//    private static final String SYS_FILE_BBOX_USB_SWITCH = "/sys/bus/platform/drivers/bbox_gpioctrl/bbox_usb_switch";
//    private static final String SYS_FILE_BBOX_VCC5V_ENABLE = "/sys/bus/platform/drivers/bbox_gpioctrl/bbox_vcc5v_enable";
//    private static final String TAG = "SystemUpgradeActivity";
//    private static final String UPDATE_FILENAME = "update.zip";
//    private static final String USB_DEVICE_ROOTPATH = "/mnt/media_rw";
//    private static boolean bUpgradeFromCache;
//    private static String mCacheUpdateFile;
//    private static String mExternalUpdateFile;
//    private static String mLocalUpdateFile;
//    private static String mUpdateFileAbsolutePath;
//    private static File mUpdatePackageFile;
//    private final int MSG_FOR_CHECK_WIPE_DATA;
//    private final int MSG_FOR_COPY_DIALOG;
//    private final int MSG_FOR_COPY_FILE_TO_CACHE;
//    private final int MSG_FOR_COPY_FILE_TO_LOCAL;
//    private final int MSG_FOR_COPY_TO_CACHE_DONE;
//    private final int MSG_FOR_COPY_TO_LOCAL_DONE;
//    private final int MSG_FOR_PRE_VERITY;
//    private final int MSG_FOR_START_UPGRADE;
//    private final int MSG_FOR_SWITCH_HUB_MODE;
//    private final int MSG_FOR_SWITCH_USB_MODE;
//    private final int MSG_FOR_TOTAL;
//    private final int MSG_FOR_VERITY_DIALOG;
//    private final int MSG_FOR_VERITY_FAIL;
//    private final int MSG_FOR_VERITY_PACKAGE;
//    private final int MSG_FOR_VERITY_SUCCESS;
//    private final int MSG_FOR_WAITING_SWITCH_MODE;
//    private final String OTG_TO_CACHE;
//    private final String OTG_TO_LOCAL;
//    private boolean bOTACertsOnlyUseOfficial;
//    private boolean bUpgradeWithWipeData;
//    private boolean bUsbSwitchModeBypass;
//    private boolean bVerityPackageEnable;
//    private boolean copyToCacheResult;
//    private boolean copyToLocalResult;
//    private int mActionReboot;
//    private Button mButtonCacheUpgrade;
//    private Button mButtonFactoryReset;
//    private Button mButtonLocalUpgrade;
//    private Button mButtonOtg2CacheUpgrade;
//    private Button mButtonOtg2LocalUpgrade;
//    private Button mButtonOtgUpgrade;
//    private Button mButtonRebootBootloader;
//    private Button mButtonRebootDevice;
//    private Button mButtonRebootRecovery;
//    private int mClickCountHintLocal;
//    private int mClickCountVerityPackage;
//    private long mClickEndTimeHintLocal;
//    private long mClickEndTimeVerityPackage;
//    private long mClickStartTimeHintLocal;
//    private long mClickStartTimeVerityPackage;
//    private ProgressDialog mCopyProgressDialog;
//    private Handler mCountTimeHandler;
//    private Timer mCountTimer;
//    private Handler mHandler;
//    private int mOTACertsCurrent;
//    private ArrayList<ArrayMap<String, String>> mOTACertsMaps;
//    private int mOTACertsTotal;
//    private RecoverySystem$ProgressListener mProgressListener;
//    private LinearLayout mRebootLayout1;
//    private LinearLayout mRebootLayout2;
//    private AlertDialog mSwitchModeDialog;
//    private Switch mSwithUpgradeWithWipe;
//    private Switch mSwithUsbMode;
//    private Switch mSwithVerityPackage;
//    private TextView mTextViewCountTime;
//    private TextView mTextViewHintLocal;
//    private TextView mTextViewVerityPackage;
//    private TimerTask mTimerTask;
//    private String[] mUSBDevicePathArray;
//    private LinearLayout mUpgradeLayoutDirect;
//    private LinearLayout mUpgradeLayoutTransfer;
//    private ProgressDialog mVerityProgressDialog;
//
//    static {
//        SystemUpgradeActivity.PERMISSIONS_ARRAYS = new String[] { "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE" };
//        SystemUpgradeActivity.mLocalUpdateFile = "";
//        SystemUpgradeActivity.mCacheUpdateFile = "";
//        SystemUpgradeActivity.mExternalUpdateFile = "";
//        SystemUpgradeActivity.mUpdateFileAbsolutePath = "";
//        SystemUpgradeActivity.mUpdatePackageFile = null;
//        SystemUpgradeActivity.bUpgradeFromCache = false;
//    }
//
//    public SystemUpgradeActivity() {
//        this.mUSBDevicePathArray = null;
//        this.MSG_FOR_COPY_DIALOG = 1;
//        this.MSG_FOR_COPY_FILE_TO_CACHE = 2;
//        this.MSG_FOR_COPY_TO_CACHE_DONE = 3;
//        this.MSG_FOR_COPY_FILE_TO_LOCAL = 4;
//        this.MSG_FOR_COPY_TO_LOCAL_DONE = 5;
//        this.MSG_FOR_START_UPGRADE = 6;
//        this.MSG_FOR_PRE_VERITY = 7;
//        this.MSG_FOR_VERITY_DIALOG = 8;
//        this.MSG_FOR_VERITY_PACKAGE = 9;
//        this.MSG_FOR_VERITY_SUCCESS = 10;
//        this.MSG_FOR_VERITY_FAIL = 11;
//        this.MSG_FOR_CHECK_WIPE_DATA = 12;
//        this.MSG_FOR_WAITING_SWITCH_MODE = 13;
//        this.MSG_FOR_SWITCH_USB_MODE = 14;
//        this.MSG_FOR_SWITCH_HUB_MODE = 15;
//        this.MSG_FOR_TOTAL = 16;
//        this.OTG_TO_CACHE = "otg2cache";
//        this.OTG_TO_LOCAL = "otg2local";
//        this.mCopyProgressDialog = null;
//        this.mVerityProgressDialog = null;
//        this.copyToCacheResult = false;
//        this.copyToLocalResult = false;
//        this.mSwithVerityPackage = null;
//        this.bVerityPackageEnable = false;
//        this.mSwithUpgradeWithWipe = null;
//        this.bUpgradeWithWipeData = false;
//        this.mSwithUsbMode = null;
//        this.bUsbSwitchModeBypass = false;
//        this.mOTACertsTotal = 0;
//        this.mOTACertsCurrent = 0;
//        this.mOTACertsMaps = null;
//        this.bOTACertsOnlyUseOfficial = false;
//        this.mActionReboot = 0;
//        this.mUpgradeLayoutDirect = null;
//        this.mUpgradeLayoutTransfer = null;
//        this.mRebootLayout1 = null;
//        this.mRebootLayout2 = null;
//        this.mButtonLocalUpgrade = null;
//        this.mButtonCacheUpgrade = null;
//        this.mButtonOtgUpgrade = null;
//        this.mButtonOtg2CacheUpgrade = null;
//        this.mButtonOtg2LocalUpgrade = null;
//        this.mButtonFactoryReset = null;
//        this.mButtonRebootRecovery = null;
//        this.mButtonRebootBootloader = null;
//        this.mButtonRebootDevice = null;
//        this.mTextViewHintLocal = null;
//        this.mClickStartTimeHintLocal = 0L;
//        this.mClickEndTimeHintLocal = 0L;
//        this.mClickCountHintLocal = 0;
//        this.mTextViewVerityPackage = null;
//        this.mClickStartTimeVerityPackage = 0L;
//        this.mClickEndTimeVerityPackage = 0L;
//        this.mClickCountVerityPackage = 0;
//        this.mTextViewCountTime = null;
//        this.mCountTimeHandler = null;
//        this.mCountTimer = null;
//        this.mTimerTask = null;
//        this.mSwitchModeDialog = null;
//        this.mHandler = new Handler() {
//            public void handleMessage(final Message message) {
//                switch (message.what) {
//                    case 15: {
//                        Log.d("SystemUpgradeActivity", "switch to hub mode");
//                        SystemUpgradeActivity.this.changeUsbAndHubMode(false);
//                        break;
//                    }
//                    case 14: {
//                        Log.d("SystemUpgradeActivity", "switch to usb mode");
//                        SystemUpgradeActivity.this.changeUsbAndHubMode(true);
//                        break;
//                    }
//                    case 13: {
//                        SystemUpgradeActivity.this.showSwitchModeDialog();
//                        break;
//                    }
//                    case 12: {
//                        if (SystemUpgradeActivity.this.bUpgradeWithWipeData) {
//                            SystemUpgradeActivity.this.showUpgradeWipdDataActionDialog();
//                            break;
//                        }
//                        this.sendEmptyMessage(6);
//                        break;
//                    }
//                    case 11: {
//                        Log.d("SystemUpgradeActivity", "verity fail");
//                        ++SystemUpgradeActivity.this.mOTACertsCurrent;
//                        final StringBuilder sb = new StringBuilder();
//                        sb.append("mOTACertsCurrent=");
//                        sb.append(SystemUpgradeActivity.this.mOTACertsCurrent);
//                        sb.append(",mOTACertsTotal=");
//                        sb.append(SystemUpgradeActivity.this.mOTACertsTotal);
//                        Log.d("SystemUpgradeActivity", sb.toString());
//                        if (SystemUpgradeActivity.this.mOTACertsCurrent < SystemUpgradeActivity.this.mOTACertsTotal) {
//                            this.sendEmptyMessage(9);
//                            break;
//                        }
//                        if (SystemUpgradeActivity.this.mVerityProgressDialog != null && SystemUpgradeActivity.this.mVerityProgressDialog.isShowing()) {
//                            SystemUpgradeActivity.this.mVerityProgressDialog.dismiss();
//                        }
//                        SystemUpgradeActivity.this.showVerityActionDialog(false);
//                        break;
//                    }
//                    case 10: {
//                        Log.d("SystemUpgradeActivity", "verity success");
//                        if (SystemUpgradeActivity.this.mVerityProgressDialog != null && SystemUpgradeActivity.this.mVerityProgressDialog.isShowing()) {
//                            SystemUpgradeActivity.this.mVerityProgressDialog.dismiss();
//                        }
//                        SystemUpgradeActivity.this.showVerityActionDialog(true);
//                        break;
//                    }
//                    case 9: {
//                        Log.d("SystemUpgradeActivity", "start verity package with key");
//                        if (SystemUpgradeActivity.mUpdatePackageFile != null && SystemUpgradeActivity.mUpdatePackageFile.exists()) {
//                            SystemUpgradeActivity.this.startVerityPackage(SystemUpgradeActivity.this.mOTACertsCurrent);
//                            break;
//                        }
//                        break;
//                    }
//                    case 8: {
//                        Log.d("SystemUpgradeActivity", "show verity progress dialog");
//                        if (SystemUpgradeActivity.mUpdatePackageFile != null && SystemUpgradeActivity.mUpdatePackageFile.exists()) {
//                            SystemUpgradeActivity.this.showVerityProgressDialog();
//                            SystemUpgradeActivity.this.mOTACertsCurrent = 0;
//                            this.sendEmptyMessage(9);
//                            break;
//                        }
//                        break;
//                    }
//                    case 7: {
//                        if (SystemUpgradeActivity.this.bVerityPackageEnable) {
//                            this.sendEmptyMessage(8);
//                            break;
//                        }
//                        SystemUpgradeActivity.this.showVerityAlertDialog(true);
//                        break;
//                    }
//                    case 6: {
//                        Log.d("SystemUpgradeActivity", "start install package");
//                        final StringBuilder sb2 = new StringBuilder();
//                        sb2.append("mUpdatePackageFile.getAbsolutePath=");
//                        sb2.append(SystemUpgradeActivity.mUpdatePackageFile.getAbsolutePath());
//                        Log.d("SystemUpgradeActivity", sb2.toString());
//                        if (!SystemUpgradeActivity.this.bUpgradeWithWipeData) {
//                            SystemUpgradeActivity.this.startInstallPackage();
//                            break;
//                        }
//                        SystemUpgradeActivity.this.startInstallPackageWithCommand();
//                        break;
//                    }
//                    case 5: {
//                        Log.d("SystemUpgradeActivity", "close copy progress dialog");
//                        if (SystemUpgradeActivity.this.mCopyProgressDialog != null) {
//                            SystemUpgradeActivity.this.mCopyProgressDialog.dismiss();
//                        }
//                        if (SystemUpgradeActivity.this.copyToLocalResult) {
//                            SystemUpgradeActivity.mUpdateFileAbsolutePath = SystemUpgradeActivity.mLocalUpdateFile;
//                            SystemUpgradeActivity.mUpdatePackageFile = new File(SystemUpgradeActivity.mLocalUpdateFile);
//                            this.sendEmptyMessage(7);
//                            break;
//                        }
//                        break;
//                    }
//                    case 4: {
//                        Log.d("SystemUpgradeActivity", "start copy file to local");
//                        SystemUpgradeActivity.this.copyFileWithThread("otg2local");
//                        break;
//                    }
//                    case 3: {
//                        Log.d("SystemUpgradeActivity", "close copy progress dialog");
//                        if (SystemUpgradeActivity.this.mCopyProgressDialog != null) {
//                            SystemUpgradeActivity.this.mCopyProgressDialog.dismiss();
//                        }
//                        if (SystemUpgradeActivity.this.copyToCacheResult) {
//                            SystemUpgradeActivity.mUpdateFileAbsolutePath = "/cache/update.zip";
//                            SystemUpgradeActivity.mUpdatePackageFile = new File("/cache/update.zip");
//                            this.sendEmptyMessage(7);
//                            break;
//                        }
//                        break;
//                    }
//                    case 2: {
//                        Log.d("SystemUpgradeActivity", "start copy file to cache");
//                        SystemUpgradeActivity.this.copyFileWithThread("otg2cache");
//                        break;
//                    }
//                    case 1: {
//                        Log.d("SystemUpgradeActivity", "show copy progress dialog");
//                        SystemUpgradeActivity.this.showCopyProgressDialog();
//                        SystemUpgradeActivity.this.copyToCacheResult = (SystemUpgradeActivity.this.copyToLocalResult = false);
//                        final String string = message.obj.toString();
//                        if (string.equals("otg2cache")) {
//                            this.sendEmptyMessage(2);
//                            break;
//                        }
//                        if (string.equals("otg2local")) {
//                            this.sendEmptyMessage(4);
//                            break;
//                        }
//                        break;
//                    }
//                }
//            }
//        };
//        this.mProgressListener = (RecoverySystem$ProgressListener)new RecoverySystem$ProgressListener() {
//            public void onProgress(final int progress) {
//                final StringBuilder sb = new StringBuilder();
//                sb.append("mProgressListener onProgress=");
//                sb.append(progress);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                if (SystemUpgradeActivity.this.mVerityProgressDialog != null) {
//                    SystemUpgradeActivity.this.mVerityProgressDialog.setProgress(progress);
//                }
//            }
//        };
//    }
//
//    private void changeUsbAndHubMode(final boolean b) {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                final String getprop = SystemHelper.getprop("ro.bbox.hw.version", "D10");
//                final StringBuilder sb = new StringBuilder();
//                sb.append("hwver=");
//                sb.append(getprop);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                final boolean b = getprop.equals("E11") || getprop.equals("D10");
//                final StringBuilder sb2 = new StringBuilder();
//                sb2.append("setVcc5v=");
//                sb2.append(b);
//                Log.d("SystemUpgradeActivity", sb2.toString());
//                if (b) {
//                    SystemHelper.setprop("debug.bbox.usb_hubreset", "1");
//                    SystemUpgradeActivity.this.delay(5000);
//                    final String exec = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_hubreset_enable");
//                    final StringBuilder sb3 = new StringBuilder();
//                    sb3.append("command_readback=");
//                    sb3.append(exec);
//                    Log.d("SystemUpgradeActivity", sb3.toString());
//                    SystemHelper.setprop("debug.bbox.usb_switch", "0");
//                    if (b) {
//                        SystemHelper.setprop("debug.bbox.vcc5v_enable", "0");
//                    }
//                    SystemUpgradeActivity.this.delay(1000);
//                    final String exec2 = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_usb_switch");
//                    final StringBuilder sb4 = new StringBuilder();
//                    sb4.append("command_readback=");
//                    sb4.append(exec2);
//                    Log.d("SystemUpgradeActivity", sb4.toString());
//                    final String exec3 = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_vcc5v_enable");
//                    final StringBuilder sb5 = new StringBuilder();
//                    sb5.append("command_readback=");
//                    sb5.append(exec3);
//                    Log.d("SystemUpgradeActivity", sb5.toString());
//                }
//                else {
//                    SystemHelper.setprop("debug.bbox.usb_hubreset", "0");
//                    SystemUpgradeActivity.this.delay(5000);
//                    final String exec4 = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_hubreset_enable");
//                    final StringBuilder sb6 = new StringBuilder();
//                    sb6.append("command_readback=");
//                    sb6.append(exec4);
//                    Log.d("SystemUpgradeActivity", sb6.toString());
//                    SystemHelper.setprop("debug.bbox.usb_switch", "1");
//                    if (b) {
//                        SystemHelper.setprop("debug.bbox.vcc5v_enable", "1");
//                    }
//                    SystemUpgradeActivity.this.delay(1000);
//                    final String exec5 = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_usb_switch");
//                    final StringBuilder sb7 = new StringBuilder();
//                    sb7.append("command_readback=");
//                    sb7.append(exec5);
//                    Log.d("SystemUpgradeActivity", sb7.toString());
//                    final String exec6 = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_vcc5v_enable");
//                    final StringBuilder sb8 = new StringBuilder();
//                    sb8.append("command_readback=");
//                    sb8.append(exec6);
//                    Log.d("SystemUpgradeActivity", sb8.toString());
//                }
//            }
//        }).start();
//    }
//
//    private boolean checkOTGStatus(final String p0) {
//        //
//        // This method could not be decompiled.
//        //
//        // Original Bytecode:
//        //
//        //     1: istore_2
//        //     2: iconst_0
//        //     3: istore_3
//        //     4: iconst_0
//        //     5: istore          4
//        //     7: iconst_0
//        //     8: istore          5
//        //    10: aconst_null
//        //    11: astore          6
//        //    13: aconst_null
//        //    14: astore          7
//        //    16: new             Ljava/lang/StringBuilder;
//        //    19: dup
//        //    20: invokespecial   java/lang/StringBuilder.<init>:()V
//        //    23: astore          8
//        //    25: aload           8
//        //    27: ldc_w           "checkOTGStatus path="
//        //    30: invokevirtual   java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
//        //    33: pop
//        //    34: aload           8
//        //    36: aload_1
//        //    37: invokevirtual   java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
//        //    40: pop
//        //    41: ldc             "SystemUpgradeActivity"
//        //    43: aload           8
//        //    45: invokevirtual   java/lang/StringBuilder.toString:()Ljava/lang/String;
//        //    48: invokestatic    android/util/Log.d:(Ljava/lang/String;Ljava/lang/String;)I
//        //    51: pop
//        //    52: aload           7
//        //    54: astore          8
//        //    56: aload           6
//        //    58: astore          9
//        //    60: new             Ljava/io/BufferedReader;
//        //    63: astore          10
//        //    65: aload           7
//        //    67: astore          8
//        //    69: aload           6
//        //    71: astore          9
//        //    73: new             Ljava/io/FileReader;
//        //    76: astore          11
//        //    78: aload           7
//        //    80: astore          8
//        //    82: aload           6
//        //    84: astore          9
//        //    86: aload           11
//        //    88: ldc             "/proc/mounts"
//        //    90: invokespecial   java/io/FileReader.<init>:(Ljava/lang/String;)V
//        //    93: aload           7
//        //    95: astore          8
//        //    97: aload           6
//        //    99: astore          9
//        //   101: aload           10
//        //   103: aload           11
//        //   105: invokespecial   java/io/BufferedReader.<init>:(Ljava/io/Reader;)V
//        //   108: aload           10
//        //   110: astore          7
//        //   112: aload           7
//        //   114: astore          8
//        //   116: aload           7
//        //   118: astore          9
//        //   120: aload           7
//        //   122: invokevirtual   java/io/BufferedReader.readLine:()Ljava/lang/String;
//        //   125: astore          6
//        //   127: iload           5
//        //   129: istore          12
//        //   131: aload           6
//        //   133: ifnull          233
//        //   136: aload           7
//        //   138: astore          8
//        //   140: aload           7
//        //   142: astore          9
//        //   144: aload           6
//        //   146: aload_1
//        //   147: invokevirtual   java/lang/String.contains:(Ljava/lang/CharSequence;)Z
//        //   150: ifeq            112
//        //   153: aload           7
//        //   155: astore          8
//        //   157: aload           7
//        //   159: astore          9
//        //   161: new             Ljava/lang/StringBuilder;
//        //   164: astore          6
//        //   166: aload           7
//        //   168: astore          8
//        //   170: aload           7
//        //   172: astore          9
//        //   174: aload           6
//        //   176: invokespecial   java/lang/StringBuilder.<init>:()V
//        //   179: aload           7
//        //   181: astore          8
//        //   183: aload           7
//        //   185: astore          9
//        //   187: aload           6
//        //   189: ldc_w           "usb mount path find="
//        //   192: invokevirtual   java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
//        //   195: pop
//        //   196: aload           7
//        //   198: astore          8
//        //   200: aload           7
//        //   202: astore          9
//        //   204: aload           6
//        //   206: aload_1
//        //   207: invokevirtual   java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
//        //   210: pop
//        //   211: aload           7
//        //   213: astore          8
//        //   215: aload           7
//        //   217: astore          9
//        //   219: ldc             "SystemUpgradeActivity"
//        //   221: aload           6
//        //   223: invokevirtual   java/lang/StringBuilder.toString:()Ljava/lang/String;
//        //   226: invokestatic    android/util/Log.d:(Ljava/lang/String;Ljava/lang/String;)I
//        //   229: pop
//        //   230: iconst_1
//        //   231: istore          12
//        //   233: iload           12
//        //   235: istore          5
//        //   237: aload           7
//        //   239: ifnull          299
//        //   242: aload           7
//        //   244: invokevirtual   java/io/BufferedReader.close:()V
//        //   247: goto            284
//        //   250: astore_1
//        //   251: goto            291
//        //   254: astore_1
//        //   255: goto            335
//        //   258: astore_1
//        //   259: aload           9
//        //   261: astore          8
//        //   263: aload_1
//        //   264: invokevirtual   java/lang/Exception.printStackTrace:()V
//        //   267: iload           4
//        //   269: istore          5
//        //   271: aload           9
//        //   273: ifnull          299
//        //   276: aload           9
//        //   278: invokevirtual   java/io/BufferedReader.close:()V
//        //   281: iload_2
//        //   282: istore          12
//        //   284: goto            295
//        //   287: astore_1
//        //   288: iload_3
//        //   289: istore          12
//        //   291: aload_1
//        //   292: invokevirtual   java/io/IOException.printStackTrace:()V
//        //   295: iload           12
//        //   297: istore          5
//        //   299: new             Ljava/lang/StringBuilder;
//        //   302: dup
//        //   303: invokespecial   java/lang/StringBuilder.<init>:()V
//        //   306: astore_1
//        //   307: aload_1
//        //   308: ldc_w           "checkOTGStatus blnRet="
//        //   311: invokevirtual   java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
//        //   314: pop
//        //   315: aload_1
//        //   316: iload           5
//        //   318: invokevirtual   java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;
//        //   321: pop
//        //   322: ldc             "SystemUpgradeActivity"
//        //   324: aload_1
//        //   325: invokevirtual   java/lang/StringBuilder.toString:()Ljava/lang/String;
//        //   328: invokestatic    android/util/Log.d:(Ljava/lang/String;Ljava/lang/String;)I
//        //   331: pop
//        //   332: iload           5
//        //   334: ireturn
//        //   335: aload           8
//        //   337: ifnull          355
//        //   340: aload           8
//        //   342: invokevirtual   java/io/BufferedReader.close:()V
//        //   345: goto            355
//        //   348: astore          8
//        //   350: aload           8
//        //   352: invokevirtual   java/io/IOException.printStackTrace:()V
//        //   355: aload_1
//        //   356: athrow
//        //    Exceptions:
//        //  Try           Handler
//        //  Start  End    Start  End    Type
//        //  -----  -----  -----  -----  ---------------------
//        //  60     65     258    284    Ljava/lang/Exception;
//        //  60     65     254    357    Any
//        //  73     78     258    284    Ljava/lang/Exception;
//        //  73     78     254    357    Any
//        //  86     93     258    284    Ljava/lang/Exception;
//        //  86     93     254    357    Any
//        //  101    108    258    284    Ljava/lang/Exception;
//        //  101    108    254    357    Any
//        //  120    127    258    284    Ljava/lang/Exception;
//        //  120    127    254    357    Any
//        //  144    153    258    284    Ljava/lang/Exception;
//        //  144    153    254    357    Any
//        //  161    166    258    284    Ljava/lang/Exception;
//        //  161    166    254    357    Any
//        //  174    179    258    284    Ljava/lang/Exception;
//        //  174    179    254    357    Any
//        //  187    196    258    284    Ljava/lang/Exception;
//        //  187    196    254    357    Any
//        //  204    211    258    284    Ljava/lang/Exception;
//        //  204    211    254    357    Any
//        //  219    230    258    284    Ljava/lang/Exception;
//        //  219    230    254    357    Any
//        //  242    247    250    254    Ljava/io/IOException;
//        //  263    267    254    357    Any
//        //  276    281    287    291    Ljava/io/IOException;
//        //  340    345    348    355    Ljava/io/IOException;
//        //
//        // The error that occurred was:
//        //
//        // java.lang.IndexOutOfBoundsException: Index: 176, Size: 176
//        //     at java.util.ArrayList.rangeCheck(ArrayList.java:657)
//        //     at java.util.ArrayList.get(ArrayList.java:433)
//        //     at com.strobel.decompiler.ast.AstBuilder.convertToAst(AstBuilder.java:3321)
//        //     at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:113)
//        //     at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:211)
//        //     at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)
//        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)
//        //     at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)
//        //     at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
//        //     at us.deathmarine.luyten.DecompilerLinkProvider.generateContent(DecompilerLinkProvider.java:97)
//        //     at us.deathmarine.luyten.OpenFile.decompileWithNavigationLinks(OpenFile.java:494)
//        //     at us.deathmarine.luyten.OpenFile.decompile(OpenFile.java:467)
//        //     at us.deathmarine.luyten.Model.extractClassToTextPane(Model.java:420)
//        //     at us.deathmarine.luyten.Model.openEntryByTreePath(Model.java:339)
//        //     at us.deathmarine.luyten.Model$TreeListener$1.run(Model.java:266)
//        //
//        throw new IllegalStateException("An error occurred while decompiling this method.");
//    }
//
//    private int checkOTGUpdateFileValid(final String s, final String s2) {
//        int n;
//        if (this.checkOTGStatus(s)) {
//            final File file = new File(s2);
//            if (file.exists()) {
//                if (file.canRead()) {
//                    SystemUpgradeActivity.mUpdateFileAbsolutePath = file.getAbsolutePath();
//                    n = 4;
//                }
//                else {
//                    final StringBuilder sb = new StringBuilder();
//                    sb.append("otgUpdateFile is NOT read=");
//                    sb.append(s2);
//                    Log.e("SystemUpgradeActivity", sb.toString());
//                    n = 3;
//                }
//            }
//            else {
//                n = 2;
//            }
//        }
//        else {
//            n = 1;
//        }
//        return n;
//    }
//
//    private void checkShowAllLayout() {
//        ++this.mClickCountHintLocal;
//        if (1 == this.mClickCountHintLocal) {
//            this.mClickStartTimeHintLocal = System.currentTimeMillis();
//        }
//        else if (7 == this.mClickCountHintLocal) {
//            this.mClickEndTimeHintLocal = System.currentTimeMillis();
//        }
//        if (this.mClickCountHintLocal >= 7) {
//            if (this.mClickEndTimeHintLocal - this.mClickStartTimeHintLocal < 3000L) {
//                Log.d("SystemUpgradeActivity", "click so fast to show layout");
//                this.showAllOtherLayout(true);
//            }
//            final StringBuilder sb = new StringBuilder();
//            sb.append("mClickEndTime-mClickStartTime=");
//            sb.append(this.mClickEndTimeHintLocal - this.mClickStartTimeHintLocal);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            this.mClickCountHintLocal = 0;
//        }
//        if (System.currentTimeMillis() - this.mClickStartTimeHintLocal > 3000L) {
//            this.mClickCountHintLocal = 0;
//            this.mClickStartTimeHintLocal = System.currentTimeMillis();
//            Log.e("SystemUpgradeActivity", "click time out");
//        }
//    }
//
//    private void checkVerityPackageSwitchEnable() {
//        ++this.mClickCountVerityPackage;
//        if (1 == this.mClickCountVerityPackage) {
//            this.mClickStartTimeVerityPackage = System.currentTimeMillis();
//        }
//        else if (7 == this.mClickCountVerityPackage) {
//            this.mClickEndTimeVerityPackage = System.currentTimeMillis();
//        }
//        if (this.mClickCountVerityPackage >= 7) {
//            if (this.mClickEndTimeVerityPackage - this.mClickStartTimeVerityPackage < 3000L) {
//                Log.d("SystemUpgradeActivity", "click so fast to enable switch");
//                this.setVerityPackageSwitchEnable(true);
//            }
//            final StringBuilder sb = new StringBuilder();
//            sb.append("mClickEndTime-mClickStartTime=");
//            sb.append(this.mClickEndTimeVerityPackage - this.mClickStartTimeVerityPackage);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            this.mClickCountVerityPackage = 0;
//        }
//        if (System.currentTimeMillis() - this.mClickStartTimeVerityPackage > 3000L) {
//            this.mClickCountVerityPackage = 0;
//            this.mClickStartTimeVerityPackage = System.currentTimeMillis();
//            Log.e("SystemUpgradeActivity", "click time out");
//        }
//    }
//
//    private boolean convertAssertToPrivateFile(final String s, final String s2) {
//        final boolean b = false;
//        boolean b2 = false;
//        final StringBuilder sb = new StringBuilder();
//        sb.append("assertPath=");
//        sb.append(s);
//        Log.d("SystemUpgradeActivity", sb.toString());
//        final StringBuilder sb2 = new StringBuilder();
//        sb2.append("privateFile=");
//        sb2.append(s2);
//        Log.d("SystemUpgradeActivity", sb2.toString());
//        final AssetManager assets = this.getAssets();
//        final InputStream inputStream = null;
//        InputStream open;
//        try {
//            open = assets.open(s);
//        }
//        catch (IOException ex) {
//            ex.printStackTrace();
//            open = inputStream;
//        }
//        try {
//            final FileOutputStream openFileOutput = this.openFileOutput(s2, 0);
//            final byte[] array = new byte[4096];
//            while (true) {
//                final int read = open.read(array);
//                if (read == -1) {
//                    break;
//                }
//                openFileOutput.write(array, 0, read);
//            }
//            open.close();
//            openFileOutput.close();
//            b2 = true;
//        }
//        catch (IOException ex2) {
//            ex2.printStackTrace();
//            b2 = b;
//        }
//        catch (FileNotFoundException ex3) {
//            ex3.printStackTrace();
//        }
//        return b2;
//    }
//
//    private void copyFileWithThread(final String s) {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                int n = -1;
//                final StringBuilder sb = new StringBuilder();
//                sb.append("mUpdateFileAbsolutePath=");
//                sb.append(SystemUpgradeActivity.mUpdateFileAbsolutePath);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                if (s.equals("otg2cache")) {
//                    SystemUpgradeActivity.this.copyToCacheResult = SystemUpgradeActivity.this.copyFile(SystemUpgradeActivity.mUpdateFileAbsolutePath, "/cache/update.zip");
//                    final StringBuilder sb2 = new StringBuilder();
//                    sb2.append("copyToCacheResult=");
//                    sb2.append(Boolean.toString(SystemUpgradeActivity.this.copyToCacheResult));
//                    Log.d("SystemUpgradeActivity", sb2.toString());
//                    n = 3;
//                }
//                else if (s.equals("otg2local")) {
//                    SystemUpgradeActivity.this.copyToLocalResult = SystemUpgradeActivity.this.copyFile(SystemUpgradeActivity.mUpdateFileAbsolutePath, SystemUpgradeActivity.mLocalUpdateFile);
//                    final StringBuilder sb3 = new StringBuilder();
//                    sb3.append("copyToLocalResult=");
//                    sb3.append(Boolean.toString(SystemUpgradeActivity.this.copyToLocalResult));
//                    Log.d("SystemUpgradeActivity", sb3.toString());
//                    n = 5;
//                }
//                if (SystemUpgradeActivity.this.mHandler != null && -1 != n) {
//                    SystemUpgradeActivity.this.mHandler.sendEmptyMessage(n);
//                }
//            }
//        }).start();
//    }
//
//    private void createOTACertToPrivateFiles() {
//        Log.d("SystemUpgradeActivity", "createOTACertToPrivateFiles");
//        this.mOTACertsMaps = new ArrayList<ArrayMap<String, String>>();
//        final ArrayMap arrayMap = new ArrayMap();
//        arrayMap.put((Object)"default", (Object)null);
//        this.mOTACertsMaps.add((ArrayMap<String, String>)arrayMap);
//        final AssetManager assets = this.getAssets();
//        String[] list = null;
//        try {
//            list = assets.list("otacerts");
//        }
//        catch (IOException ex) {
//            ex.printStackTrace();
//        }
//        final StringBuilder sb = new StringBuilder();
//        sb.append("files.length=");
//        sb.append(list.length);
//        Log.d("SystemUpgradeActivity", sb.toString());
//        for (int i = 0; i < list.length; ++i) {
//            Log.d("SystemUpgradeActivity", list[i]);
//            final StringBuilder sb2 = new StringBuilder();
//            sb2.append("otacerts/");
//            sb2.append(list[i]);
//            if (this.convertAssertToPrivateFile(sb2.toString(), list[i])) {
//                final StringBuilder sb3 = new StringBuilder();
//                sb3.append(this.getFilesDir());
//                sb3.append("/");
//                sb3.append(list[i]);
//                final String string = sb3.toString();
//                final ArrayMap arrayMap2 = new ArrayMap();
//                arrayMap2.put((Object)list[i], (Object)string);
//                this.mOTACertsMaps.add((ArrayMap<String, String>)arrayMap2);
//            }
//        }
//        this.mOTACertsTotal = this.mOTACertsMaps.size();
//        final StringBuilder sb4 = new StringBuilder();
//        sb4.append("mOTACertsMaps.size=");
//        sb4.append(this.mOTACertsTotal);
//        Log.d("SystemUpgradeActivity", sb4.toString());
//        for (int j = 0; j < this.mOTACertsTotal; ++j) {
//            final ArrayMap<String, String> arrayMap3 = this.mOTACertsMaps.get(j);
//            final String s = (String)arrayMap3.keyAt(0);
//            final String s2 = (String)arrayMap3.valueAt(0);
//            final StringBuilder sb5 = new StringBuilder();
//            sb5.append("key=");
//            sb5.append(s);
//            sb5.append(",value=");
//            sb5.append(s2);
//            Log.d("SystemUpgradeActivity", sb5.toString());
//        }
//    }
//
//    private void delay(final int n) {
//        final long n2 = n;
//        try {
//            Thread.sleep(n2);
//        }
//        catch (InterruptedException ex) {
//            ex.printStackTrace();
//        }
//    }
//
//    private void deleteOTACertFile() {
//        Log.d("SystemUpgradeActivity", "deleteOTACertFile");
//        for (int i = 0; i < this.mOTACertsTotal; ++i) {
//            this.deleteFile((String)this.mOTACertsMaps.get(i).keyAt(0));
//        }
//    }
//
//    private String doConfirmAction(final boolean b, final boolean b2) {
//        final String s = "";
//        String s2 = null;
//        switch (this.mActionReboot) {
//            default: {
//                s2 = s;
//                break;
//            }
//            case 4: {
//                if (b) {
//                    s2 = this.getResources().getString(2131427375);
//                    break;
//                }
//                s2 = s;
//                if (b2) {
//                    this.startRebootDevices();
//                    s2 = s;
//                    break;
//                }
//                break;
//            }
//            case 3: {
//                if (b) {
//                    s2 = this.getResources().getString(2131427374);
//                    break;
//                }
//                s2 = s;
//                if (b2) {
//                    this.startRebootToBootloader();
//                    s2 = s;
//                    break;
//                }
//                break;
//            }
//            case 2: {
//                if (b) {
//                    s2 = this.getResources().getString(2131427377);
//                    break;
//                }
//                s2 = s;
//                if (b2) {
//                    this.startRebootToRecovery();
//                    s2 = s;
//                    break;
//                }
//                break;
//            }
//            case 1: {
//                if (b) {
//                    s2 = this.getResources().getString(2131427376);
//                    break;
//                }
//                s2 = s;
//                if (b2) {
//                    this.startFactoryReset();
//                    s2 = s;
//                    break;
//                }
//                break;
//            }
//        }
//        return s2;
//    }
//
//    private long getCachePartitionTotalSize() {
//        final long n = 0L;
//        long n2;
//        try {
//            final Process exec = Runtime.getRuntime().exec("df");
//            n2 = n;
//            if (exec != null) {
//                final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(exec.getInputStream()));
//                while (true) {
//                    final String line = bufferedReader.readLine();
//                    n2 = n;
//                    if (line == null) {
//                        break;
//                    }
//                    final StringBuilder sb = new StringBuilder();
//                    sb.append("line=");
//                    sb.append(line);
//                    Log.d("SystemUpgradeActivity", sb.toString());
//                    final String[] split = line.split(" +");
//                    if (split.length >= 6 && split[split.length - 1].equals("/cache")) {
//                        final StringBuilder sb2 = new StringBuilder();
//                        sb2.append("find cache size=");
//                        sb2.append(split[1]);
//                        Log.d("SystemUpgradeActivity", sb2.toString());
//                        n2 = Integer.parseInt(split[1]);
//                        break;
//                    }
//                }
//            }
//        }
//        catch (IOException ex) {
//            ex.printStackTrace();
//            n2 = n;
//        }
//        return n2;
//    }
//
//    private String getCacheTotalSize() {
//        final File downloadCacheDirectory = Environment.getDownloadCacheDirectory();
//        final StringBuilder sb = new StringBuilder();
//        sb.append("cache path=");
//        sb.append(downloadCacheDirectory.getPath());
//        Log.d("SystemUpgradeActivity", sb.toString());
//        final StatFs statFs = new StatFs(downloadCacheDirectory.getPath());
//        final long n = statFs.getBlockSize();
//        final long n2 = statFs.getBlockCount();
//        final StringBuilder sb2 = new StringBuilder();
//        sb2.append("blockSize=");
//        sb2.append(String.valueOf(n));
//        sb2.append(", totalBlocks=");
//        sb2.append(String.valueOf(n2));
//        Log.d("SystemUpgradeActivity", sb2.toString());
//        return Formatter.formatFileSize((Context)this, n * n2);
//    }
//
//    private long getCacheTotalSizeBytes() {
//        final File downloadCacheDirectory = Environment.getDownloadCacheDirectory();
//        final StringBuilder sb = new StringBuilder();
//        sb.append("cache path=");
//        sb.append(downloadCacheDirectory.getPath());
//        Log.d("SystemUpgradeActivity", sb.toString());
//        final StatFs statFs = new StatFs(downloadCacheDirectory.getPath());
//        final long n = statFs.getBlockSize();
//        final long n2 = statFs.getBlockCount();
//        final StringBuilder sb2 = new StringBuilder();
//        sb2.append("blockSize=");
//        sb2.append(String.valueOf(n));
//        sb2.append(", totalBlocks=");
//        sb2.append(String.valueOf(n2));
//        Log.d("SystemUpgradeActivity", sb2.toString());
//        final StringBuilder sb3 = new StringBuilder();
//        sb3.append("blockSize * totalBlocks=");
//        sb3.append(n * n2);
//        Log.d("SystemUpgradeActivity", sb3.toString());
//        return n * n2;
//    }
//
//    private List<File> getUSBDevicesPath(final String s, final List<File> list) {
//        final File file = new File(s);
//        if (file.isDirectory()) {
//            final File[] listFiles = file.listFiles();
//            if (listFiles != null) {
//                for (final File file2 : listFiles) {
//                    if (file2.isDirectory()) {
//                        list.add(file2);
//                    }
//                }
//            }
//        }
//        return list;
//    }
//
//    private boolean getUsbMode() {
//        boolean b = false;
//        final String exec = SystemHelper.exec("cat /sys/bus/platform/drivers/bbox_gpioctrl/bbox_usb_switch");
//        final StringBuilder sb = new StringBuilder();
//        sb.append("usb_switch_value=");
//        sb.append(exec);
//        Log.d("SystemUpgradeActivity", sb.toString());
//        final String substring = exec.substring(0, "bbox_usb_switch = 0".length());
//        final StringBuilder sb2 = new StringBuilder();
//        sb2.append("usb_switch_value=");
//        sb2.append(substring);
//        Log.d("SystemUpgradeActivity", sb2.toString());
//        if (substring.equals("bbox_usb_switch = 0")) {
//            b = true;
//        }
//        final StringBuilder sb3 = new StringBuilder();
//        sb3.append("usb_mode=");
//        sb3.append(b);
//        Log.d("SystemUpgradeActivity", sb3.toString());
//        return b;
//    }
//
//    private void initUpdateFile() {
//        try {
//            final StringBuilder sb = new StringBuilder();
//            sb.append(Environment.getExternalStorageDirectory().toString());
//            sb.append("/");
//            sb.append("update.zip");
//            SystemUpgradeActivity.mLocalUpdateFile = sb.toString();
//            final StringBuilder sb2 = new StringBuilder();
//            sb2.append("mLocalUpdateFile=");
//            sb2.append(SystemUpgradeActivity.mLocalUpdateFile);
//            Log.d("SystemUpgradeActivity", sb2.toString());
//        }
//        catch (Exception ex) {
//            ex.printStackTrace();
//        }
//        try {
//            SystemUpgradeActivity.mCacheUpdateFile = "/cache/update.zip";
//            final StringBuilder sb3 = new StringBuilder();
//            sb3.append("mCacheUpdateFile=");
//            sb3.append(SystemUpgradeActivity.mCacheUpdateFile);
//            Log.d("SystemUpgradeActivity", sb3.toString());
//        }
//        catch (Exception ex2) {
//            ex2.printStackTrace();
//        }
//        try {
//            SystemUpgradeActivity.mExternalUpdateFile = "/mnt/media_rw/usbotgoem/update.zip";
//            final StringBuilder sb4 = new StringBuilder();
//            sb4.append("mExternalUpdateFile=");
//            sb4.append(SystemUpgradeActivity.mExternalUpdateFile);
//            Log.d("SystemUpgradeActivity", sb4.toString());
//        }
//        catch (Exception ex3) {
//            ex3.printStackTrace();
//        }
//        final List<File> usbDevicesPath = this.getUSBDevicesPath("/mnt/media_rw", new ArrayList<File>());
//        final StringBuilder sb5 = new StringBuilder();
//        sb5.append("usbDevicesPaths size=");
//        sb5.append(usbDevicesPath.size());
//        Log.d("SystemUpgradeActivity", sb5.toString());
//        if (usbDevicesPath.size() > 0) {
//            this.mUSBDevicePathArray = new String[usbDevicesPath.size()];
//            for (int i = 0; i < usbDevicesPath.size(); ++i) {
//                this.mUSBDevicePathArray[i] = usbDevicesPath.get(i).getPath();
//                final StringBuilder sb6 = new StringBuilder();
//                sb6.append("mUSBDevicePathArray=");
//                sb6.append(this.mUSBDevicePathArray[i]);
//                Log.d("SystemUpgradeActivity", sb6.toString());
//            }
//        }
//        else {
//            Log.e("SystemUpgradeActivity", "no usb device");
//        }
//    }
//
//    private void loadOTACertfFile() {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                SystemUpgradeActivity.this.createOTACertToPrivateFiles();
//            }
//        }).start();
//    }
//
//    private void rebootImpl() {
//        final Intent intent = new Intent("android.intent.action.REBOOT");
//        intent.putExtra("nowait", 1);
//        intent.putExtra("interval", 1);
//        intent.putExtra("window", 0);
//        this.sendBroadcast(intent);
//    }
//
//    private void rebootShell() {
//        try {
//            Runtime.getRuntime().exec("su -c reboot");
//        }
//        catch (Exception ex) {
//            Log.e("SystemUpgradeActivity", "Runtime exec error");
//        }
//    }
//
//    private void sendMessage(final int what, final String obj) {
//        if (this.mHandler != null) {
//            final Message message = new Message();
//            message.what = what;
//            message.obj = obj;
//            this.mHandler.sendMessage(message);
//        }
//        else {
//            Log.e("SystemUpgradeActivity", "mHandler = null");
//            final StringBuilder sb = new StringBuilder();
//            sb.append("info=");
//            sb.append(obj);
//            Log.e("SystemUpgradeActivity", sb.toString());
//        }
//    }
//
//    private void setVerityPackageSwitchEnable(final boolean b) {
//        if (b) {
//            this.mSwithVerityPackage.setEnabled(true);
//        }
//        else {
//            this.mSwithVerityPackage.setEnabled(false);
//        }
//    }
//
//    private void showAllOtherLayout(final boolean b) {
//        final boolean bUpgradeFromCache = SystemUpgradeActivity.bUpgradeFromCache;
//        int n = 8;
//        if (bUpgradeFromCache) {
//            final LinearLayout mUpgradeLayoutDirect = this.mUpgradeLayoutDirect;
//            int visibility;
//            if (b) {
//                visibility = 0;
//            }
//            else {
//                visibility = 8;
//            }
//            mUpgradeLayoutDirect.setVisibility(visibility);
//            final Button mButtonOtg2LocalUpgrade = this.mButtonOtg2LocalUpgrade;
//            if (b) {
//                n = 0;
//            }
//            mButtonOtg2LocalUpgrade.setVisibility(n);
//        }
//        else {
//            final LinearLayout mUpgradeLayoutDirect2 = this.mUpgradeLayoutDirect;
//            int visibility2;
//            if (b) {
//                visibility2 = 0;
//            }
//            else {
//                visibility2 = 8;
//            }
//            mUpgradeLayoutDirect2.setVisibility(visibility2);
//            final Button mButtonLocalUpgrade = this.mButtonLocalUpgrade;
//            int visibility3;
//            if (b) {
//                visibility3 = 0;
//            }
//            else {
//                visibility3 = 8;
//            }
//            mButtonLocalUpgrade.setVisibility(visibility3);
//            final Button mButtonCacheUpgrade = this.mButtonCacheUpgrade;
//            int visibility4;
//            if (b) {
//                visibility4 = 0;
//            }
//            else {
//                visibility4 = 8;
//            }
//            mButtonCacheUpgrade.setVisibility(visibility4);
//            final Button mButtonOtg2CacheUpgrade = this.mButtonOtg2CacheUpgrade;
//            if (b) {
//                n = 0;
//            }
//            mButtonOtg2CacheUpgrade.setVisibility(n);
//            this.mButtonCacheUpgrade.setEnabled(false);
//            this.mButtonOtg2CacheUpgrade.setEnabled(false);
//        }
//        final LinearLayout mRebootLayout1 = this.mRebootLayout1;
//        final int n2 = 4;
//        int visibility5;
//        if (b) {
//            visibility5 = 0;
//        }
//        else {
//            visibility5 = 4;
//        }
//        mRebootLayout1.setVisibility(visibility5);
//        final LinearLayout mRebootLayout2 = this.mRebootLayout2;
//        int visibility6 = n2;
//        if (b) {
//            visibility6 = 0;
//        }
//        mRebootLayout2.setVisibility(visibility6);
//    }
//
//    private void showConfirmActionDialog() {
//        final AlertDialog show = new AlertDialog$Builder((Context)this).setTitle((CharSequence)this.getResources().getString(2131427359)).setIcon(2131099739).setMessage((CharSequence)this.doConfirmAction(true, false)).setPositiveButton((CharSequence)this.getResources().getString(2131427358), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Positive");
//                SystemUpgradeActivity.this.doConfirmAction(false, true);
//            }
//        }).setNegativeButton((CharSequence)this.getResources().getString(2131427357), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Negative");
//            }
//        }).show();
//        Log.d("SystemUpgradeActivity", "AlertDialog");
//        show.setCanceledOnTouchOutside(false);
//    }
//
//    private void showCopyProgressDialog() {
//        (this.mCopyProgressDialog = new ProgressDialog((Context)this)).setTitle((CharSequence)this.getResources().getString(2131427369));
//        this.mCopyProgressDialog.setIcon(2131099741);
//        this.mCopyProgressDialog.setMessage((CharSequence)this.getResources().getString(2131427368));
//        this.mCopyProgressDialog.setCanceledOnTouchOutside(false);
//        this.mCopyProgressDialog.show();
//    }
//
//    private void showSwitchModeDialog() {
//        (this.mTextViewCountTime = new TextView((Context)this)).setGravity(17);
//        this.mTextViewCountTime.setTextSize(32.0f);
//        this.mTextViewCountTime.setTextColor(this.getResources().getColor(2130968767));
//        this.mTextViewCountTime.setText((CharSequence)Integer.toString(10));
//        this.mSwitchModeDialog = new AlertDialog$Builder((Context)this).setTitle((CharSequence)this.getResources().getString(2131427399)).setIcon(2131099739).setView((View)this.mTextViewCountTime).setCancelable(false).show();
//        Log.d("SystemUpgradeActivity", "AlertDialog");
//        this.mSwitchModeDialog.setCanceledOnTouchOutside(false);
//        this.startCountTimeUtils();
//    }
//
//    private void showUpgradeWipdDataActionDialog() {
//        final AlertDialog show = new AlertDialog$Builder((Context)this).setTitle((CharSequence)this.getResources().getString(2131427359)).setIcon(2131099739).setMessage((CharSequence)this.getResources().getString(2131427393)).setPositiveButton((CharSequence)this.getResources().getString(2131427358), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Positive");
//                SystemUpgradeActivity.this.mHandler.sendEmptyMessage(6);
//            }
//        }).setNegativeButton((CharSequence)this.getResources().getString(2131427357), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Negative");
//            }
//        }).show();
//        Log.d("SystemUpgradeActivity", "AlertDialog");
//        show.setCanceledOnTouchOutside(false);
//    }
//
//    private void showUpgradeWithWipeDataLayout(final boolean b) {
//        this.mButtonLocalUpgrade.setEnabled(b ^ true);
//        this.mButtonOtg2LocalUpgrade.setEnabled(b ^ true);
//    }
//
//    private void showVerityActionDialog(final boolean b) {
//        String title;
//        if (b) {
//            title = this.getResources().getString(2131427363);
//        }
//        else {
//            title = this.getResources().getString(2131427362);
//        }
//        String message;
//        if (b) {
//            message = this.getResources().getString(2131427361);
//        }
//        else {
//            message = this.getResources().getString(2131427360);
//        }
//        int icon;
//        if (b) {
//            icon = 2131099746;
//        }
//        else {
//            icon = 2131099742;
//        }
//        final AlertDialog show = new AlertDialog$Builder((Context)this).setTitle((CharSequence)title).setIcon(icon).setMessage((CharSequence)message).setPositiveButton((CharSequence)this.getResources().getString(2131427358), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Positive");
//                if (b) {
//                    Log.d("SystemUpgradeActivity", "verity true for send start upgrade message");
//                    if (SystemUpgradeActivity.this.mHandler != null) {
//                        SystemUpgradeActivity.this.mHandler.sendEmptyMessage(12);
//                    }
//                }
//            }
//        }).setNegativeButton((CharSequence)this.getResources().getString(2131427357), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Negative");
//            }
//        }).show();
//        Log.d("SystemUpgradeActivity", "AlertDialog");
//        show.setCanceledOnTouchOutside(false);
//    }
//
//    private void showVerityAlertDialog(final boolean b) {
//        final AlertDialog show = new AlertDialog$Builder((Context)this).setTitle((CharSequence)this.getResources().getString(2131427397)).setIcon(2131099739).setMessage((CharSequence)this.getResources().getString(2131427396)).setPositiveButton((CharSequence)this.getResources().getString(2131427358), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Positive");
//                SystemUpgradeActivity.this.mHandler.sendEmptyMessage(12);
//            }
//        }).setNegativeButton((CharSequence)this.getResources().getString(2131427357), (DialogInterface$OnClickListener)new DialogInterface$OnClickListener() {
//            public void onClick(final DialogInterface dialogInterface, final int n) {
//                Log.d("SystemUpgradeActivity", "onClick Negative");
//            }
//        }).show();
//        Log.d("SystemUpgradeActivity", "AlertDialog");
//        show.setCanceledOnTouchOutside(false);
//    }
//
//    private void showVerityProgressDialog() {
//        (this.mVerityProgressDialog = new ProgressDialog((Context)this)).setTitle((CharSequence)this.getResources().getString(2131427397));
//        this.mVerityProgressDialog.setIcon(2131099743);
//        this.mVerityProgressDialog.setMessage((CharSequence)this.getResources().getString(2131427395));
//        this.mVerityProgressDialog.setProgressStyle(1);
//        this.mVerityProgressDialog.setCanceledOnTouchOutside(false);
//        this.mVerityProgressDialog.show();
//    }
//
//    private void startCacheUpdate() {
//        Log.d("SystemUpgradeActivity", "startCacheUpdate");
//        try {
//            final StringBuilder sb = new StringBuilder();
//            sb.append("startCacheUpdate=");
//            sb.append(SystemUpgradeActivity.mCacheUpdateFile);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            final File file = new File(SystemUpgradeActivity.mCacheUpdateFile);
//            if (file.exists()) {
//                if (file.canRead()) {
//                    Log.d("SystemUpgradeActivity", "mCacheUpdateFile exist and read");
//                    final String absolutePath = file.getAbsolutePath();
//                    final StringBuilder sb2 = new StringBuilder();
//                    sb2.append("filePath=");
//                    sb2.append(absolutePath);
//                    Log.d("SystemUpgradeActivity", sb2.toString());
//                    SystemUpgradeActivity.mUpdateFileAbsolutePath = absolutePath;
//                    SystemUpgradeActivity.mUpdatePackageFile = new File(absolutePath);
//                    if (this.mHandler != null) {
//                        this.mHandler.sendEmptyMessage(7);
//                    }
//                }
//                else {
//                    Log.e("SystemUpgradeActivity", "mCacheUpdateFile is NOT read");
//                }
//            }
//            else {
//                Log.e("SystemUpgradeActivity", "mCacheUpdateFile is NOT exist");
//                Toast.makeText((Context)this, this.getText(2131427365), 1).show();
//            }
//        }
//        catch (Exception ex) {
//            Log.e("SystemUpgradeActivity", "mCacheUpdateFile catch error");
//            ex.printStackTrace();
//        }
//    }
//
//    private void startCountTimeUtils() {
//        this.mCountTimeHandler = new Handler() {
//            public void handleMessage(final Message message) {
//                if (message.what > 0) {
//                    final StringBuilder sb = new StringBuilder();
//                    sb.append("msg.what=");
//                    sb.append(message.what);
//                    Log.d("SystemUpgradeActivity", sb.toString());
//                    if (SystemUpgradeActivity.this.mTextViewCountTime != null) {
//                        SystemUpgradeActivity.this.mTextViewCountTime.setText((CharSequence)Integer.toString(message.what));
//                    }
//                }
//                else {
//                    if (SystemUpgradeActivity.this.mSwitchModeDialog != null) {
//                        SystemUpgradeActivity.this.mTextViewCountTime = null;
//                        SystemUpgradeActivity.this.mSwitchModeDialog.dismiss();
//                        SystemUpgradeActivity.this.mSwitchModeDialog = null;
//                        Log.d("SystemUpgradeActivity", "AlertDialog dismiss");
//                    }
//                    if (SystemUpgradeActivity.this.mCountTimer != null) {
//                        SystemUpgradeActivity.this.mCountTimer.cancel();
//                        SystemUpgradeActivity.this.mCountTimer = null;
//                    }
//                    if (SystemUpgradeActivity.this.mTimerTask != null) {
//                        SystemUpgradeActivity.this.mTimerTask.cancel();
//                        SystemUpgradeActivity.this.mTimerTask = null;
//                    }
//                }
//                super.handleMessage(message);
//            }
//        };
//        this.mCountTimer = new Timer(true);
//        this.mTimerTask = new TimerTask() {
//            int countTime = 10;
//
//            @Override
//            public void run() {
//                if (this.countTime > 0) {
//                    --this.countTime;
//                }
//                final StringBuilder sb = new StringBuilder();
//                sb.append("countTime=");
//                sb.append(this.countTime);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                final Message message = new Message();
//                message.what = this.countTime;
//                SystemUpgradeActivity.this.mCountTimeHandler.sendMessage(message);
//            }
//        };
//        this.mCountTimer.schedule(this.mTimerTask, 1000L, 1000L);
//    }
//
//    private void startFactoryReset() {
//        final Intent intent = new Intent("android.intent.action.MASTER_CLEAR");
//        intent.addFlags(268435456);
//        intent.putExtra("android.intent.extra.REASON", "MasterClearConfirm");
//        intent.setPackage("android");
//        this.sendBroadcast(intent);
//    }
//
//    private void startInstallPackage() {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                Log.d("SystemUpgradeActivity", "startInstallPackage");
//                final StringBuilder sb = new StringBuilder();
//                sb.append("mUpdatePackageFile.getAbsolutePath=");
//                sb.append(SystemUpgradeActivity.mUpdatePackageFile.getAbsolutePath());
//                Log.d("SystemUpgradeActivity", sb.toString());
//                if (SystemUpgradeActivity.mUpdatePackageFile != null && SystemUpgradeActivity.mUpdatePackageFile.exists()) {
//                    try {
//                        RecoverySystem.installPackage((Context)SystemUpgradeActivity.this, SystemUpgradeActivity.mUpdatePackageFile);
//                    }
//                    catch (IOException ex) {
//                        ex.printStackTrace();
//                    }
//                }
//            }
//        }).start();
//    }
//
//    private void startInstallPackageWithCommand() {
//        final boolean b = false;
//        final File file = new File("/cache/recovery/command");
//        if (!file.exists()) {
//            Log.d("SystemUpgradeActivity", "/cache/recovery/command is NOT exists");
//            try {
//                final boolean newFile = file.createNewFile();
//                final StringBuilder sb = new StringBuilder();
//                sb.append("/cache/recovery/command create=");
//                sb.append(newFile);
//                Log.d("SystemUpgradeActivity", sb.toString());
//            }
//            catch (IOException ex) {
//                ex.printStackTrace();
//            }
//        }
//        boolean b2 = b;
//        if (SystemUpgradeActivity.mUpdatePackageFile != null) {
//            final StringBuilder sb2 = new StringBuilder();
//            sb2.append("mUpdatePackageFile.getAbsolutePath=");
//            sb2.append(SystemUpgradeActivity.mUpdatePackageFile.getAbsolutePath());
//            Log.d("SystemUpgradeActivity", sb2.toString());
//            b2 = b;
//            if (SystemUpgradeActivity.mUpdatePackageFile.exists()) {
//                final StringBuilder sb3 = new StringBuilder();
//                sb3.append("--update_package=");
//                sb3.append(SystemUpgradeActivity.mUpdatePackageFile.getAbsolutePath());
//                sb3.append("\n");
//                final String string = sb3.toString();
//                final StringBuilder sb4 = new StringBuilder();
//                sb4.append(string);
//                sb4.append("--wipe_data\n");
//                sb4.append("--locale=zh-CN\n");
//                final String string2 = sb4.toString();
//                final StringBuilder sb5 = new StringBuilder();
//                sb5.append("command=");
//                sb5.append(string2);
//                Log.d("SystemUpgradeActivity", sb5.toString());
//                try {
//                    final FileOutputStream fileOutputStream = new FileOutputStream(file);
//                    fileOutputStream.write(this.strToByteArray(string2));
//                    fileOutputStream.close();
//                    b2 = true;
//                }
//                catch (IOException ex2) {
//                    ex2.printStackTrace();
//                    b2 = b;
//                }
//            }
//        }
//        final StringBuilder sb6 = new StringBuilder();
//        sb6.append("upgrade_cmd=");
//        sb6.append(b2);
//        Log.d("SystemUpgradeActivity", sb6.toString());
//        if (b2) {
//            this.startRebootToRecovery();
//        }
//    }
//
//    private void startLocalUpdate() {
//        Log.d("SystemUpgradeActivity", "startLocalUpdate");
//        try {
//            final StringBuilder sb = new StringBuilder();
//            sb.append("mLocalUpdateFile=");
//            sb.append(SystemUpgradeActivity.mLocalUpdateFile);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            final File file = new File(SystemUpgradeActivity.mLocalUpdateFile);
//            if (file.exists()) {
//                if (file.canRead()) {
//                    Log.d("SystemUpgradeActivity", "mLocalUpdateFile exist and read");
//                    final String absolutePath = file.getAbsolutePath();
//                    final StringBuilder sb2 = new StringBuilder();
//                    sb2.append("filePath=");
//                    sb2.append(absolutePath);
//                    Log.d("SystemUpgradeActivity", sb2.toString());
//                    final String[] split = absolutePath.split("/");
//                    final StringBuilder sb3 = new StringBuilder();
//                    sb3.append("dataStr.length=");
//                    sb3.append(split.length);
//                    Log.d("SystemUpgradeActivity", sb3.toString());
//                    String string = "/data/media/0";
//                    for (int i = 4; i < split.length; ++i) {
//                        final StringBuilder sb4 = new StringBuilder();
//                        sb4.append(string);
//                        sb4.append("/");
//                        sb4.append(split[i]);
//                        string = sb4.toString();
//                    }
//                    final StringBuilder sb5 = new StringBuilder();
//                    sb5.append("fileTruePath=");
//                    sb5.append(string);
//                    Log.d("SystemUpgradeActivity", sb5.toString());
//                    SystemUpgradeActivity.mUpdateFileAbsolutePath = string;
//                    SystemUpgradeActivity.mUpdatePackageFile = new File(string);
//                    if (this.mHandler != null) {
//                        this.mHandler.sendEmptyMessage(7);
//                    }
//                }
//                else {
//                    Log.e("SystemUpgradeActivity", "mLocalUpdateFile is NOT read");
//                }
//            }
//            else {
//                Log.e("SystemUpgradeActivity", "mLocalUpdateFile is NOT exist");
//                Toast.makeText((Context)this, this.getText(2131427371), 1).show();
//            }
//        }
//        catch (Exception ex) {
//            Log.e("SystemUpgradeActivity", "mLocalUpdateFile catch error");
//            ex.printStackTrace();
//        }
//    }
//
//    private void startOTGToCacheUpdate() {
//        Log.d("SystemUpgradeActivity", "startOTGToCacheUpdate");
//        final boolean b = false;
//        boolean b2 = false;
//        final boolean b3 = false;
//        final boolean b4 = false;
//        try {
//            final StringBuilder sb = new StringBuilder();
//            sb.append("mExternalUpdateFile=");
//            sb.append(SystemUpgradeActivity.mExternalUpdateFile);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            boolean b6;
//            boolean b7;
//            if (this.checkOTGStatus("/mnt/media_rw/usbotgoem")) {
//                final boolean b5 = true;
//                final File file = new File(SystemUpgradeActivity.mExternalUpdateFile);
//                b6 = b4;
//                if (file.exists()) {
//                    if (file.canRead()) {
//                        b6 = true;
//                        Log.d("SystemUpgradeActivity", "mExternalUpdateFile exist and read");
//                        final String absolutePath = file.getAbsolutePath();
//                        final StringBuilder sb2 = new StringBuilder();
//                        sb2.append("filePath=");
//                        sb2.append(absolutePath);
//                        Log.d("SystemUpgradeActivity", sb2.toString());
//                        SystemUpgradeActivity.mUpdateFileAbsolutePath = absolutePath;
//                        if (this.mHandler != null) {
//                            this.mHandler.sendEmptyMessage(1);
//                        }
//                    }
//                    else {
//                        Log.e("SystemUpgradeActivity", "mExternalUpdateFile is NOT read");
//                        b6 = b4;
//                    }
//                }
//                b7 = b5;
//            }
//            else {
//                b7 = b;
//                b6 = b3;
//                if (this.mUSBDevicePathArray != null) {
//                    b7 = b;
//                    b6 = b3;
//                    if (this.mUSBDevicePathArray.length > 0) {
//                        int n = 0;
//                        while (true) {
//                            b7 = b2;
//                            b6 = b3;
//                            if (n >= this.mUSBDevicePathArray.length) {
//                                break;
//                            }
//                            SystemUpgradeActivity.mExternalUpdateFile = this.mUSBDevicePathArray[n];
//                            final StringBuilder sb3 = new StringBuilder();
//                            sb3.append("mExternalUpdateFile=");
//                            sb3.append(SystemUpgradeActivity.mExternalUpdateFile);
//                            Log.d("SystemUpgradeActivity", sb3.toString());
//                            if (!SystemUpgradeActivity.mExternalUpdateFile.equals("/mnt/media_rw/usbotg")) {
//                                if (this.checkOTGStatus(SystemUpgradeActivity.mExternalUpdateFile)) {
//                                    final boolean b8 = true;
//                                    final boolean b9 = true;
//                                    final StringBuilder sb4 = new StringBuilder();
//                                    sb4.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    sb4.append("/");
//                                    sb4.append("update.zip");
//                                    SystemUpgradeActivity.mExternalUpdateFile = sb4.toString();
//                                    final StringBuilder sb5 = new StringBuilder();
//                                    sb5.append("mExternalUpdateFile=");
//                                    sb5.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    Log.d("SystemUpgradeActivity", sb5.toString());
//                                    final File file2 = new File(SystemUpgradeActivity.mExternalUpdateFile);
//                                    if (file2.exists()) {
//                                        if (file2.canRead()) {
//                                            final boolean b10 = true;
//                                            Log.d("SystemUpgradeActivity", "mExternalUpdateFile exist and read");
//                                            final String absolutePath2 = file2.getAbsolutePath();
//                                            final StringBuilder sb6 = new StringBuilder();
//                                            sb6.append("filePath=");
//                                            sb6.append(absolutePath2);
//                                            Log.d("SystemUpgradeActivity", sb6.toString());
//                                            SystemUpgradeActivity.mUpdateFileAbsolutePath = absolutePath2;
//                                            b7 = b8;
//                                            b6 = b10;
//                                            if (this.mHandler != null) {
//                                                this.mHandler.sendEmptyMessage(1);
//                                                b7 = b8;
//                                                b6 = b10;
//                                                break;
//                                            }
//                                            break;
//                                        }
//                                        else {
//                                            Log.e("SystemUpgradeActivity", "mExternalUpdateFile is NOT read");
//                                        }
//                                    }
//                                    else {
//                                        final StringBuilder sb7 = new StringBuilder();
//                                        sb7.append("file NOT exist=");
//                                        sb7.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                        Log.e("SystemUpgradeActivity", sb7.toString());
//                                    }
//                                    b2 = b9;
//                                }
//                                else {
//                                    final StringBuilder sb8 = new StringBuilder();
//                                    sb8.append("checkOTGStatus error=");
//                                    sb8.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    Log.e("SystemUpgradeActivity", sb8.toString());
//                                }
//                            }
//                            else {
//                                final StringBuilder sb9 = new StringBuilder();
//                                sb9.append("skip the usbotg=");
//                                sb9.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                Log.e("SystemUpgradeActivity", sb9.toString());
//                            }
//                            ++n;
//                        }
//                    }
//                }
//            }
//            final StringBuilder sb10 = new StringBuilder();
//            sb10.append("findUSBDevice=");
//            sb10.append(Boolean.toString(b7));
//            Log.d("SystemUpgradeActivity", sb10.toString());
//            final StringBuilder sb11 = new StringBuilder();
//            sb11.append("updateFile=");
//            sb11.append(Boolean.toString(b6));
//            Log.d("SystemUpgradeActivity", sb11.toString());
//            if (!b7) {
//                final StringBuilder sb12 = new StringBuilder();
//                sb12.append("mExternalUpdateFile=");
//                sb12.append(SystemUpgradeActivity.mExternalUpdateFile);
//                sb12.append(" is NOT mount");
//                Log.e("SystemUpgradeActivity", sb12.toString());
//                Toast.makeText((Context)this, this.getText(2131427383), 1).show();
//            }
//            else if (!b6) {
//                final StringBuilder sb13 = new StringBuilder();
//                sb13.append("mExternalUpdateFile=");
//                sb13.append(SystemUpgradeActivity.mExternalUpdateFile);
//                sb13.append(" is NOT mount");
//                Log.e("SystemUpgradeActivity", sb13.toString());
//                Toast.makeText((Context)this, this.getText(2131427384), 1).show();
//            }
//        }
//        catch (Exception ex) {
//            Log.e("SystemUpgradeActivity", "mExternalUpdateFile catch error");
//            ex.printStackTrace();
//        }
//    }
//
//    private void startOTGTransferToDeviceUpdate(final String s) {
//        Log.d("SystemUpgradeActivity", "startOTGTransferToDeviceUpdate");
//        try {
//            SystemUpgradeActivity.mUpdateFileAbsolutePath = "";
//            final StringBuilder sb = new StringBuilder();
//            sb.append("mExternalUpdateFile=");
//            sb.append(SystemUpgradeActivity.mExternalUpdateFile);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            int n2;
//            int n = n2 = this.checkOTGUpdateFileValid("/mnt/media_rw/usbotgoem", SystemUpgradeActivity.mExternalUpdateFile);
//            if (4 != n) {
//                n2 = n;
//                if (this.mUSBDevicePathArray != null) {
//                    n2 = n;
//                    if (this.mUSBDevicePathArray.length > 0) {
//                        int n3 = 0;
//                        while (true) {
//                            n2 = n;
//                            if (n3 >= this.mUSBDevicePathArray.length) {
//                                break;
//                            }
//                            SystemUpgradeActivity.mExternalUpdateFile = this.mUSBDevicePathArray[n3];
//                            final StringBuilder sb2 = new StringBuilder();
//                            sb2.append("mExternalUpdateFile=");
//                            sb2.append(SystemUpgradeActivity.mExternalUpdateFile);
//                            Log.d("SystemUpgradeActivity", sb2.toString());
//                            if (!SystemUpgradeActivity.mExternalUpdateFile.equals("/mnt/media_rw/usbotg")) {
//                                final String mExternalUpdateFile = SystemUpgradeActivity.mExternalUpdateFile;
//                                final StringBuilder sb3 = new StringBuilder();
//                                sb3.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                sb3.append("/");
//                                sb3.append("update.zip");
//                                n2 = this.checkOTGUpdateFileValid(mExternalUpdateFile, sb3.toString());
//                                if (4 == (n = n2)) {
//                                    final StringBuilder sb4 = new StringBuilder();
//                                    sb4.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    sb4.append("/");
//                                    sb4.append("update.zip");
//                                    SystemUpgradeActivity.mExternalUpdateFile = sb4.toString();
//                                    break;
//                                }
//                            }
//                            ++n3;
//                        }
//                    }
//                }
//            }
//            if (4 == n2) {
//                final StringBuilder sb5 = new StringBuilder();
//                sb5.append("mExternalUpdateFile=");
//                sb5.append(SystemUpgradeActivity.mExternalUpdateFile);
//                Log.d("SystemUpgradeActivity", sb5.toString());
//                final StringBuilder sb6 = new StringBuilder();
//                sb6.append("mUpdateFileAbsolutePath=");
//                sb6.append(SystemUpgradeActivity.mUpdateFileAbsolutePath);
//                Log.d("SystemUpgradeActivity", sb6.toString());
//                if (this.mHandler != null) {
//                    this.sendMessage(1, s);
//                }
//            }
//            else if (n2 != 0) {
//                final StringBuilder sb7 = new StringBuilder();
//                sb7.append("mExternalUpdateFile=");
//                sb7.append(SystemUpgradeActivity.mExternalUpdateFile);
//                sb7.append(" is NOT mount");
//                Log.e("SystemUpgradeActivity", sb7.toString());
//                Toast.makeText((Context)this, this.getText(2131427383), 1).show();
//            }
//            else if (2 == n2) {
//                final StringBuilder sb8 = new StringBuilder();
//                sb8.append("mExternalUpdateFile=");
//                sb8.append(SystemUpgradeActivity.mExternalUpdateFile);
//                sb8.append(" is NOT mount");
//                Log.e("SystemUpgradeActivity", sb8.toString());
//                Toast.makeText((Context)this, this.getText(2131427384), 1).show();
//            }
//        }
//        catch (Exception ex) {
//            Log.e("SystemUpgradeActivity", "mExternalUpdateFile catch error");
//            ex.printStackTrace();
//        }
//    }
//
//    private void startOTGUpdate() {
//        Log.d("SystemUpgradeActivity", "startOTGUpdate");
//        final boolean b = false;
//        boolean b2 = false;
//        final boolean b3 = false;
//        final boolean b4 = false;
//        try {
//            final StringBuilder sb = new StringBuilder();
//            sb.append("mExternalUpdateFile=");
//            sb.append(SystemUpgradeActivity.mExternalUpdateFile);
//            Log.d("SystemUpgradeActivity", sb.toString());
//            boolean b6;
//            boolean b7;
//            if (this.checkOTGStatus("/mnt/media_rw/usbotgoem")) {
//                final boolean b5 = true;
//                final File file = new File(SystemUpgradeActivity.mExternalUpdateFile);
//                b6 = b4;
//                if (file.exists()) {
//                    if (file.canRead()) {
//                        b6 = true;
//                        Log.d("SystemUpgradeActivity", "mExternalUpdateFile exist and read");
//                        final String absolutePath = file.getAbsolutePath();
//                        final StringBuilder sb2 = new StringBuilder();
//                        sb2.append("filePath=");
//                        sb2.append(absolutePath);
//                        Log.d("SystemUpgradeActivity", sb2.toString());
//                        SystemUpgradeActivity.mUpdateFileAbsolutePath = SystemUpgradeActivity.mExternalUpdateFile;
//                        SystemUpgradeActivity.mUpdatePackageFile = new File(SystemUpgradeActivity.mExternalUpdateFile);
//                        if (this.mHandler != null) {
//                            this.mHandler.sendEmptyMessage(7);
//                        }
//                    }
//                    else {
//                        Log.e("SystemUpgradeActivity", "mExternalUpdateFile is NOT read");
//                        b6 = b4;
//                    }
//                }
//                b7 = b5;
//            }
//            else {
//                b7 = b;
//                b6 = b3;
//                if (this.mUSBDevicePathArray != null) {
//                    b7 = b;
//                    b6 = b3;
//                    if (this.mUSBDevicePathArray.length > 0) {
//                        int n = 0;
//                        while (true) {
//                            b7 = b2;
//                            b6 = b3;
//                            if (n >= this.mUSBDevicePathArray.length) {
//                                break;
//                            }
//                            SystemUpgradeActivity.mExternalUpdateFile = this.mUSBDevicePathArray[n];
//                            final StringBuilder sb3 = new StringBuilder();
//                            sb3.append("mExternalUpdateFile=");
//                            sb3.append(SystemUpgradeActivity.mExternalUpdateFile);
//                            Log.d("SystemUpgradeActivity", sb3.toString());
//                            if (!SystemUpgradeActivity.mExternalUpdateFile.equals("/mnt/media_rw/usbotg")) {
//                                if (this.checkOTGStatus(SystemUpgradeActivity.mExternalUpdateFile)) {
//                                    final boolean b8 = true;
//                                    final boolean b9 = true;
//                                    final StringBuilder sb4 = new StringBuilder();
//                                    sb4.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    sb4.append("/");
//                                    sb4.append("update.zip");
//                                    SystemUpgradeActivity.mExternalUpdateFile = sb4.toString();
//                                    final StringBuilder sb5 = new StringBuilder();
//                                    sb5.append("mExternalUpdateFile=");
//                                    sb5.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    Log.d("SystemUpgradeActivity", sb5.toString());
//                                    final File file2 = new File(SystemUpgradeActivity.mExternalUpdateFile);
//                                    if (file2.exists()) {
//                                        if (file2.canRead()) {
//                                            final boolean b10 = true;
//                                            Log.d("SystemUpgradeActivity", "mExternalUpdateFile exist and read");
//                                            final String absolutePath2 = file2.getAbsolutePath();
//                                            final StringBuilder sb6 = new StringBuilder();
//                                            sb6.append("filePath=");
//                                            sb6.append(absolutePath2);
//                                            Log.d("SystemUpgradeActivity", sb6.toString());
//                                            SystemUpgradeActivity.mUpdateFileAbsolutePath = SystemUpgradeActivity.mExternalUpdateFile;
//                                            SystemUpgradeActivity.mUpdatePackageFile = new File(SystemUpgradeActivity.mExternalUpdateFile);
//                                            b7 = b8;
//                                            b6 = b10;
//                                            if (this.mHandler != null) {
//                                                this.mHandler.sendEmptyMessage(7);
//                                                b7 = b8;
//                                                b6 = b10;
//                                                break;
//                                            }
//                                            break;
//                                        }
//                                        else {
//                                            Log.e("SystemUpgradeActivity", "mExternalUpdateFile is NOT read");
//                                        }
//                                    }
//                                    else {
//                                        final StringBuilder sb7 = new StringBuilder();
//                                        sb7.append("file NOT exist=");
//                                        sb7.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                        Log.e("SystemUpgradeActivity", sb7.toString());
//                                    }
//                                    b2 = b9;
//                                }
//                                else {
//                                    final StringBuilder sb8 = new StringBuilder();
//                                    sb8.append("checkOTGStatus error=");
//                                    sb8.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                    Log.e("SystemUpgradeActivity", sb8.toString());
//                                }
//                            }
//                            else {
//                                final StringBuilder sb9 = new StringBuilder();
//                                sb9.append("skip the usbotg=");
//                                sb9.append(SystemUpgradeActivity.mExternalUpdateFile);
//                                Log.e("SystemUpgradeActivity", sb9.toString());
//                            }
//                            ++n;
//                        }
//                    }
//                }
//            }
//            final StringBuilder sb10 = new StringBuilder();
//            sb10.append("findUSBDevice=");
//            sb10.append(Boolean.toString(b7));
//            Log.d("SystemUpgradeActivity", sb10.toString());
//            final StringBuilder sb11 = new StringBuilder();
//            sb11.append("updateFile=");
//            sb11.append(Boolean.toString(b6));
//            Log.d("SystemUpgradeActivity", sb11.toString());
//            if (!b7) {
//                final StringBuilder sb12 = new StringBuilder();
//                sb12.append("mExternalUpdateFile=");
//                sb12.append(SystemUpgradeActivity.mExternalUpdateFile);
//                sb12.append(" is NOT mount");
//                Log.e("SystemUpgradeActivity", sb12.toString());
//                Toast.makeText((Context)this, this.getText(2131427383), 1).show();
//            }
//            else if (!b6) {
//                final StringBuilder sb13 = new StringBuilder();
//                sb13.append("mExternalUpdateFile=");
//                sb13.append(SystemUpgradeActivity.mExternalUpdateFile);
//                sb13.append(" is NOT mount");
//                Log.e("SystemUpgradeActivity", sb13.toString());
//                Toast.makeText((Context)this, this.getText(2131427384), 1).show();
//            }
//        }
//        catch (Exception ex) {
//            Log.e("SystemUpgradeActivity", "mExternalUpdateFile catch error");
//            ex.printStackTrace();
//        }
//    }
//
//    private void startRebootDevices() {
//        Log.d("SystemUpgradeActivity", "startRebootDevices");
//        this.rebootImpl();
//    }
//
//    private void startRebootToBootloader() {
//        Log.d("SystemUpgradeActivity", "startRebootToBootloader");
//        ((PowerManager)this.getSystemService("power")).reboot("bootloader");
//    }
//
//    private void startRebootToRecovery() {
//        Log.d("SystemUpgradeActivity", "startRebootToRecovery");
//        ((PowerManager)this.getSystemService("power")).reboot("recovery");
//    }
//
//    private void startVerityPackage(final int n) {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                final boolean b = false;
//                final boolean b2 = false;
//                boolean access$2600 = false;
//                final StringBuilder sb = new StringBuilder();
//                sb.append("startVerityPackage otaCertsCurrent=");
//                sb.append(n);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                final ArrayMap arrayMap = SystemUpgradeActivity.this.mOTACertsMaps.get(n);
//                final String s = (String)arrayMap.keyAt(0);
//                final String s2 = (String)arrayMap.valueAt(0);
//                final StringBuilder sb2 = new StringBuilder();
//                sb2.append("otaCertsName=");
//                sb2.append(s);
//                Log.d("SystemUpgradeActivity", sb2.toString());
//                final StringBuilder sb3 = new StringBuilder();
//                sb3.append("otaCertsFile=");
//                sb3.append(s2);
//                Log.d("SystemUpgradeActivity", sb3.toString());
//                final StringBuilder sb4 = new StringBuilder();
//                sb4.append("bOTACertsOnlyUseOfficial=");
//                sb4.append(SystemUpgradeActivity.this.bOTACertsOnlyUseOfficial);
//                Log.d("SystemUpgradeActivity", sb4.toString());
//                if (SystemUpgradeActivity.this.bOTACertsOnlyUseOfficial) {
//                    if (-1 != s.indexOf("otacerts_official")) {
//                        access$2600 = true;
//                    }
//                }
//                else {
//                    access$2600 = true;
//                }
//                final StringBuilder sb5 = new StringBuilder();
//                sb5.append("otaCertsValid=");
//                sb5.append(access$2600);
//                Log.d("SystemUpgradeActivity", sb5.toString());
//                Label_0552: {
//                    if (access$2600) {
//                        while (true) {
//                            try {
//                                try {
//                                    access$2600 = SystemUpgradeActivity.this.verityUpdatePackage(s2);
//                                }
//                                finally {}
//                            }
//                            catch (GeneralSecurityException ex) {
//                                final StringBuilder sb6 = new StringBuilder();
//                                sb6.append("GeneralSecurityException=");
//                                sb6.append(ex.getMessage());
//                                Log.e("SystemUpgradeActivity", sb6.toString());
//                                ex.printStackTrace();
//                                access$2600 = b2;
//                                continue;
//                            }
//                            catch (SignatureException ex2) {
//                                final StringBuilder sb7 = new StringBuilder();
//                                sb7.append("SignatureException=");
//                                sb7.append(ex2.getMessage());
//                                Log.e("SystemUpgradeActivity", sb7.toString());
//                                ex2.printStackTrace();
//                                access$2600 = b2;
//                                continue;
//                            }
//                            catch (IOException ex3) {
//                                final StringBuilder sb8 = new StringBuilder();
//                                sb8.append("IOException=");
//                                sb8.append(ex3.getMessage());
//                                Log.e("SystemUpgradeActivity", sb8.toString());
//                                ex3.printStackTrace();
//                                access$2600 = b2;
//                                continue;
//                            }
//                            break;
//                        }
//                        final StringBuilder sb9 = new StringBuilder();
//                        sb9.append("startVerityPackage verityResult=");
//                        sb9.append(access$2600);
//                        Log.d("SystemUpgradeActivity", sb9.toString());
//                        break Label_0552;
//                    }
//                    final StringBuilder sb10 = new StringBuilder();
//                    sb10.append("otaCertsValid=");
//                    sb10.append(access$2600);
//                    Log.e("SystemUpgradeActivity", sb10.toString());
//                    final StringBuilder sb11 = new StringBuilder();
//                    sb11.append("verityResult=");
//                    sb11.append(false);
//                    Log.e("SystemUpgradeActivity", sb11.toString());
//                    access$2600 = b;
//                }
//                if (SystemUpgradeActivity.this.mHandler != null) {
//                    if (access$2600) {
//                        SystemUpgradeActivity.this.mHandler.sendEmptyMessage(10);
//                    }
//                    else {
//                        SystemUpgradeActivity.this.mHandler.sendEmptyMessage(11);
//                    }
//                }
//            }
//        }).start();
//    }
//
//    private byte[] strToByteArray(final String s) {
//        if (s == null) {
//            return null;
//        }
//        return s.getBytes();
//    }
//
//    private void verifyActivityPermissions() {
//        try {
//            if (ContextCompat.checkSelfPermission((Context)this, SystemUpgradeActivity.PERMISSIONS_ARRAYS[0]) != 0) {
//                ActivityCompat.requestPermissions(this, SystemUpgradeActivity.PERMISSIONS_ARRAYS, 1);
//            }
//        }
//        catch (Exception ex) {
//            ex.printStackTrace();
//        }
//    }
//
//    private boolean verityUpdatePackage(final String s) throws IOException, GeneralSecurityException, SignatureException {
//        boolean b = false;
//        Label_0089: {
//            if (s != null) {
//                final StringBuilder sb = new StringBuilder();
//                sb.append("verityUpdatePackage otaCerts=");
//                sb.append(s);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                final File file = new File(s);
//                if (file.exists()) {
//                    Log.d("SystemUpgradeActivity", "otaCerts is exist");
//                    break Label_0089;
//                }
//                Log.e("SystemUpgradeActivity", "otaCerts is NOT exist");
//                break Label_0089;
//            }
//            final File file = null;
//            Log.d("SystemUpgradeActivity", "otaCerts using the system key");
//            while (true) {
//                try {
//                    try {
//                        RecoverySystem.verifyPackage(SystemUpgradeActivity.mUpdatePackageFile, this.mProgressListener, file);
//                        b = true;
//                    }
//                    finally {}
//                }
//                catch (GeneralSecurityException ex) {
//                    final StringBuilder sb2 = new StringBuilder();
//                    sb2.append("GeneralSecurityException=");
//                    sb2.append(ex.getMessage());
//                    Log.e("SystemUpgradeActivity", sb2.toString());
//                    ex.printStackTrace();
//                    continue;
//                }
//                catch (SignatureException ex2) {
//                    final StringBuilder sb3 = new StringBuilder();
//                    sb3.append("SignatureException=");
//                    sb3.append(ex2.getMessage());
//                    Log.e("SystemUpgradeActivity", sb3.toString());
//                    ex2.printStackTrace();
//                    continue;
//                }
//                catch (IOException ex3) {
//                    final StringBuilder sb4 = new StringBuilder();
//                    sb4.append("IOException=");
//                    sb4.append(ex3.getMessage());
//                    Log.e("SystemUpgradeActivity", sb4.toString());
//                    ex3.printStackTrace();
//                    continue;
//                }
//                break;
//            }
//        }
//        final StringBuilder sb5 = new StringBuilder();
//        sb5.append("verifyPackage verityResult=");
//        sb5.append(b);
//        Log.d("SystemUpgradeActivity", sb5.toString());
//        return b;
//    }
//
//    public boolean copyFile(final String s, final String s2) {
//        final boolean b = false;
//        boolean b2 = false;
//        Log.d("SystemUpgradeActivity", "copyFile");
//        final StringBuilder sb = new StringBuilder();
//        sb.append("oldFile=");
//        sb.append(s);
//        Log.d("SystemUpgradeActivity", sb.toString());
//        int n = 0;
//        try {
//            if (new File(s).exists()) {
//                Log.d("SystemUpgradeActivity", "oldFile ok");
//                final FileInputStream fileInputStream = new FileInputStream(s);
//                final FileOutputStream fileOutputStream = new FileOutputStream(s2);
//                final byte[] array = new byte[1048576];
//                while (true) {
//                    final int read = fileInputStream.read(array);
//                    if (read == -1) {
//                        break;
//                    }
//                    n += read;
//                    fileOutputStream.write(array, 0, read);
//                }
//                fileInputStream.close();
//                fileOutputStream.close();
//                b2 = true;
//            }
//            else {
//                Log.d("SystemUpgradeActivity", "oldFile is NOT exist");
//            }
//        }
//        catch (Exception ex) {
//            Log.d("SystemUpgradeActivity", "copyFile error");
//            ex.printStackTrace();
//            b2 = b;
//        }
//        return b2;
//    }
//
//    public void onCheckedChanged(final CompoundButton compoundButton, final boolean b) {
//        switch (compoundButton.getId()) {
//            case 2131165304: {
//                if (b) {
//                    this.bVerityPackageEnable = true;
//                }
//                else {
//                    this.bVerityPackageEnable = false;
//                }
//                final StringBuilder sb = new StringBuilder();
//                sb.append("bVerityPackageEnable=");
//                sb.append(this.bVerityPackageEnable);
//                Log.d("SystemUpgradeActivity", sb.toString());
//                break;
//            }
//            case 2131165303: {
//                if (b) {
//                    this.bUpgradeWithWipeData = true;
//                }
//                else {
//                    this.bUpgradeWithWipeData = false;
//                }
//                final StringBuilder sb2 = new StringBuilder();
//                sb2.append("bUpgradeWithWipeData=");
//                sb2.append(this.bUpgradeWithWipeData);
//                Log.d("SystemUpgradeActivity", sb2.toString());
//                this.showUpgradeWithWipeDataLayout(this.bUpgradeWithWipeData);
//                break;
//            }
//            case 2131165302: {
//                final StringBuilder sb3 = new StringBuilder();
//                sb3.append("bUsbSwitchModeBypass=");
//                sb3.append(this.bUsbSwitchModeBypass);
//                Log.d("SystemUpgradeActivity", sb3.toString());
//                if (!this.bUsbSwitchModeBypass) {
//                    this.bUsbSwitchModeBypass = true;
//                    break;
//                }
//                if (this.mHandler != null) {
//                    this.mHandler.sendEmptyMessage(13);
//                }
//                if (b) {
//                    this.mHandler.sendEmptyMessageDelayed(14, 100L);
//                    break;
//                }
//                this.mHandler.sendEmptyMessageDelayed(15, 100L);
//                break;
//            }
//        }
//    }
//
//    public void onClick(final View view) {
//        final int id = view.getId();
//        if (id != 2131165312) {
//            if (id != 2131165316) {
//                switch (id) {
//                    case 2131165227: {
//                        Log.d("SystemUpgradeActivity", "onClick reboot recovery");
//                        this.mActionReboot = 2;
//                        this.showConfirmActionDialog();
//                        break;
//                    }
//                    case 2131165226: {
//                        Log.d("SystemUpgradeActivity", "onClick reboot devices");
//                        this.mActionReboot = 4;
//                        this.showConfirmActionDialog();
//                        break;
//                    }
//                    case 2131165225: {
//                        Log.d("SystemUpgradeActivity", "onClick reboot bootloader");
//                        this.mActionReboot = 3;
//                        this.showConfirmActionDialog();
//                        break;
//                    }
//                    case 2131165224: {
//                        Log.d("SystemUpgradeActivity", "onClick OTG upgrade");
//                        this.startOTGUpdate();
//                        break;
//                    }
//                    case 2131165223: {
//                        Log.d("SystemUpgradeActivity", "onClick OTG TO Local upgrade");
//                        this.startOTGTransferToDeviceUpdate("otg2local");
//                        break;
//                    }
//                    case 2131165222: {
//                        Log.d("SystemUpgradeActivity", "onClick OTG TO Cache upgrade");
//                        this.startOTGTransferToDeviceUpdate("otg2cache");
//                        break;
//                    }
//                    case 2131165221: {
//                        Log.d("SystemUpgradeActivity", "onClick local upgrade");
//                        this.startLocalUpdate();
//                        break;
//                    }
//                    case 2131165220: {
//                        Log.d("SystemUpgradeActivity", "onClick factory reset");
//                        this.mActionReboot = 1;
//                        this.showConfirmActionDialog();
//                        break;
//                    }
//                    case 2131165219: {
//                        Log.d("SystemUpgradeActivity", "onClick cache upgrade");
//                        this.startCacheUpdate();
//                        break;
//                    }
//                }
//            }
//            else {
//                this.checkVerityPackageSwitchEnable();
//            }
//        }
//        else {
//            this.checkShowAllLayout();
//        }
//    }
//
//    @Override
//    protected void onCreate(final Bundle bundle) {
//        super.onCreate(bundle);
//        this.setContentView(2131296282);
//        final ActionBar supportActionBar = this.getSupportActionBar();
//        if (supportActionBar != null) {
//            supportActionBar.setHomeButtonEnabled(true);
//            supportActionBar.setDisplayHomeAsUpEnabled(true);
//        }
//        this.verifyActivityPermissions();
//        this.mUpgradeLayoutDirect = this.findViewById(2131165325);
//        this.mUpgradeLayoutTransfer = this.findViewById(2131165326);
//        this.mRebootLayout1 = this.findViewById(2131165270);
//        this.mRebootLayout2 = this.findViewById(2131165271);
//        (this.mButtonLocalUpgrade = this.findViewById(2131165221)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonCacheUpgrade = this.findViewById(2131165219)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonOtgUpgrade = this.findViewById(2131165224)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonOtg2CacheUpgrade = this.findViewById(2131165222)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonOtg2LocalUpgrade = this.findViewById(2131165223)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonFactoryReset = this.findViewById(2131165220)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonRebootRecovery = this.findViewById(2131165227)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonRebootBootloader = this.findViewById(2131165225)).setOnClickListener((View$OnClickListener)this);
//        (this.mButtonRebootDevice = this.findViewById(2131165226)).setOnClickListener((View$OnClickListener)this);
//        (this.mSwithVerityPackage = this.findViewById(2131165304)).setOnCheckedChangeListener((CompoundButton$OnCheckedChangeListener)this);
//        (this.mSwithUpgradeWithWipe = this.findViewById(2131165303)).setOnCheckedChangeListener((CompoundButton$OnCheckedChangeListener)this);
//        (this.mSwithUsbMode = this.findViewById(2131165302)).setOnCheckedChangeListener((CompoundButton$OnCheckedChangeListener)this);
//        (this.mTextViewHintLocal = this.findViewById(2131165312)).setOnClickListener((View$OnClickListener)this);
//        (this.mTextViewVerityPackage = this.findViewById(2131165316)).setOnClickListener((View$OnClickListener)this);
//        final StringBuilder sb = new StringBuilder();
//        sb.append("CACHE_PARTITION_SIZE_MINIMUM=");
//        sb.append(Math.abs(1572864L));
//        Log.d("SystemUpgradeActivity", sb.toString());
//        SystemUpgradeActivity.bUpgradeFromCache = (this.getCachePartitionTotalSize() > Math.abs(1572864L));
//        final StringBuilder sb2 = new StringBuilder();
//        sb2.append("bUpgradeFromCache=");
//        sb2.append(SystemUpgradeActivity.bUpgradeFromCache);
//        Log.d("SystemUpgradeActivity", sb2.toString());
//        if (Build.TYPE.equals("eng")) {
//            this.showAllOtherLayout(false);
//            this.setVerityPackageSwitchEnable(false);
//        }
//        else {
//            this.showAllOtherLayout(true);
//        }
//        this.bVerityPackageEnable = this.mSwithVerityPackage.isChecked();
//        final StringBuilder sb3 = new StringBuilder();
//        sb3.append("default bVerityPackageEnable=");
//        sb3.append(this.bVerityPackageEnable);
//        Log.d("SystemUpgradeActivity", sb3.toString());
//        this.initUpdateFile();
//        this.loadOTACertfFile();
//        if (Build.TYPE.equals("user")) {
//            this.bOTACertsOnlyUseOfficial = true;
//        }
//        final StringBuilder sb4 = new StringBuilder();
//        sb4.append("bOTACertsOnlyUseOfficial=");
//        sb4.append(this.bOTACertsOnlyUseOfficial);
//        Log.d("SystemUpgradeActivity", sb4.toString());
//        if (this.getUsbMode()) {
//            this.mSwithUsbMode.setChecked(true);
//        }
//        else {
//            this.bUsbSwitchModeBypass = true;
//        }
//    }
//
//    public void onDestroy() {
//        if (this.mHandler != null) {
//            for (int i = 0; i < 16; ++i) {
//                this.mHandler.removeMessages(i);
//            }
//        }
//        this.deleteOTACertFile();
//        super.onDestroy();
//    }
//
//    public boolean onOptionsItemSelected(final MenuItem menuItem) {
//        if (menuItem.getItemId() != 16908332) {
//            return super.onOptionsItemSelected(menuItem);
//        }
//        this.finish();
//        return true;
//    }
//
//    public static class SystemHelper
//    {
//        private static final String TAG;
//
//        static {
//            TAG = SystemHelper.class.getSimpleName();
//        }
//
//        public static String exec(String string) {
//            try {
//                final Process exec = Runtime.getRuntime().exec(string);
//                exec.waitFor();
//                final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(exec.getInputStream()));
//                final char[] array = new char[4096];
//                final StringBuffer sb = new StringBuffer();
//                while (true) {
//                    final int read = bufferedReader.read(array);
//                    if (read <= 0) {
//                        break;
//                    }
//                    sb.append(array, 0, read);
//                }
//                bufferedReader.close();
//                string = sb.toString();
//                return string;
//            }
//            catch (Exception ex) {
//                ex.printStackTrace();
//                throw new RuntimeException(ex);
//            }
//            catch (InterruptedException ex2) {
//                ex2.printStackTrace();
//                throw new RuntimeException(ex2);
//            }
//            catch (IOException ex3) {
//                ex3.printStackTrace();
//                throw new RuntimeException(ex3);
//            }
//        }
//
//        public static String getprop(final String s) {
//            return getprop(s, "unknown");
//        }
//
//        public static String getprop(String s, final String s2) {
//            String s3 = s2;
//            try {
//                final Class<?> forName = Class.forName("android.os.SystemProperties");
//                s = (s3 = (String)forName.getMethod("get", String.class, String.class).invoke(forName, s, s2));
//            }
//            catch (Exception ex) {
//                ex.printStackTrace();
//            }
//            return s3;
//        }
//
//        public static void setprop(final String s, final String s2) {
//            try {
//                final Class<?> forName = Class.forName("android.os.SystemProperties");
//                forName.getMethod("set", String.class, String.class).invoke(forName, s, s2);
//            }
//            catch (Exception ex) {
//                final String tag = SystemHelper.TAG;
//                final StringBuilder sb = new StringBuilder();
//                sb.append("key=");
//                sb.append(s);
//                sb.append(" size=");
//                sb.append(s.length());
//                Log.d(tag, sb.toString());
//                ex.printStackTrace();
//            }
//        }
//
//        public enum PlatformType
//        {
//            Mediatek,
//            Qualcomm,
//            Unknown;
//        }
//    }
//}
